Files
30-seconds-of-code/test3/is/is.test.js
Angelos Chalaris 5afe81452a Migrated tests to jest
Used jest-codemods to migrate, will have to pass everything by hand before we can merge.
2018-06-18 14:18:25 +03:00

25 lines
969 B
JavaScript

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();
});