Files
30-seconds-of-code/test/shallowClone/shallowClone.test.js
Angelos Chalaris a78f5db260 Test migration to jest by hand
Apparently using regular expressions is way easier.
2018-06-18 15:15:56 +03:00

14 lines
362 B
JavaScript

const expect = require('expect');
const shallowClone = require('./shallowClone.js');
test('shallowClone is a Function', () => {
expect(shallowClone).toBeInstanceOf(Function);
});
const a = { foo: 'bar', obj: { a: 1, b: 2 } };
const b = shallowClone(a);
t.notEqual(a, b, 'Shallow cloning works');
t.equal(a.obj, b.obj, 'Does not clone deeply');