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

2
test3/is/is.js Normal file
View File

@@ -0,0 +1,2 @@
const is = (type, val) => ![, null].includes(val) && val.constructor === type;
module.exports = is;

24
test3/is/is.test.js Normal file
View File

@@ -0,0 +1,24 @@
const expect = require('expect');
const is = require('./is.js');
test('Testing is', () => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
expect(typeof is === 'function').toBeTruthy();
expect(is(Array, [1])).toBeTruthy();
expect(is(Array, [])).toBeTruthy();
expect(is(Array, {})).toBeFalsy();
expect(is(Object, {})).toBeTruthy();
expect(is(Map, new Map())).toBeTruthy();
expect(is(RegExp, /./g)).toBeTruthy();
expect(is(Set, new Set())).toBeTruthy();
expect(is(WeakMap, new WeakMap())).toBeTruthy();
expect(is(WeakSet, new WeakSet())).toBeTruthy();
expect(is(String, '')).toBeTruthy();
expect(is(String, new String(''))).toBeTruthy();
expect(is(Number, 1)).toBeTruthy();
expect(is(Number, new Number('10'))).toBeTruthy();
expect(is(Boolean, false)).toBeTruthy();
expect(is(Boolean, new Boolean(false))).toBeTruthy();
expect(is(Function, () => null)).toBeTruthy();
});