Migrated tests to jest
Used jest-codemods to migrate, will have to pass everything by hand before we can merge.
This commit is contained in:
@@ -1,21 +1,16 @@
|
||||
const test = require('tape');
|
||||
const expect = require('expect');
|
||||
const deepClone = require('./deepClone.js');
|
||||
|
||||
test('Testing deepClone', (t) => {
|
||||
test('Testing deepClone', () => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof deepClone === 'function', 'deepClone is a Function');
|
||||
expect(typeof deepClone === 'function').toBeTruthy();
|
||||
const a = { foo: 'bar', obj: { a: 1, b: 2 } };
|
||||
const b = deepClone(a);
|
||||
const c = [{foo: "bar"}];
|
||||
const d = deepClone(c);
|
||||
t.notEqual(a, b, 'Shallow cloning works');
|
||||
t.notEqual(a.obj, b.obj, 'Deep cloning works');
|
||||
t.notEqual(c, d, "Array shallow cloning works");
|
||||
t.notEqual(c[0], d[0], "Array deep cloning works");
|
||||
//t.deepEqual(deepClone(args..), 'Expected');
|
||||
//t.equal(deepClone(args..), 'Expected');
|
||||
//t.false(deepClone(args..), 'Expected');
|
||||
//t.throws(deepClone(args..), 'Expected');
|
||||
t.end();
|
||||
expect(a).not.toBe(b);
|
||||
expect(a.obj).not.toBe(b.obj);
|
||||
expect(c).not.toBe(d);
|
||||
expect(c[0]).not.toBe(d[0]);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user