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:
Angelos Chalaris
2018-06-18 14:18:25 +03:00
parent 63ec2596cf
commit a59af893bf
890 changed files with 6950 additions and 6921 deletions

View File

@@ -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]);
});