Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
13
test/lowercaseKeys/lowercaseKeys.test.js
Normal file
13
test/lowercaseKeys/lowercaseKeys.test.js
Normal file
@ -0,0 +1,13 @@
|
||||
const expect = require('expect');
|
||||
const lowercaseKeys = require('./lowercaseKeys.js');
|
||||
|
||||
|
||||
test('lowercaseKeys is a Function', () => {
|
||||
expect(lowercaseKeys).toBeInstanceOf(Function);
|
||||
});
|
||||
const myObj = { Name: 'Adam', sUrnAME: 'Smith' };
|
||||
const myObjLower = lowercaseKeys(myObj);
|
||||
t.deepEqual(myObjLower, {name: 'Adam', surname: 'Smith'}, 'Lowercases object keys');
|
||||
t.deepEqual(myObj, { Name: 'Adam', sUrnAME: 'Smith' }, 'Does not mutate original object');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user