Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
7
test/toHash/toHash.js
Normal file
7
test/toHash/toHash.js
Normal file
@ -0,0 +1,7 @@
|
||||
const toHash = (object, key) =>
|
||||
Array.prototype.reduce.call(
|
||||
object,
|
||||
(acc, data, index) => ((acc[!key ? index : data[key]] = data), acc),
|
||||
{}
|
||||
);
|
||||
module.exports = toHash;
|
||||
8
test/toHash/toHash.test.js
Normal file
8
test/toHash/toHash.test.js
Normal file
@ -0,0 +1,8 @@
|
||||
const expect = require('expect');
|
||||
const toHash = require('./toHash.js');
|
||||
|
||||
|
||||
test('toHash is a Function', () => {
|
||||
expect(toHash).toBeInstanceOf(Function);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user