Test cleanup and fixes [c-d]
This commit is contained in:
@ -5,16 +5,36 @@ const isPrimitive = require('./isPrimitive.js');
|
||||
test('isPrimitive is a Function', () => {
|
||||
expect(isPrimitive).toBeInstanceOf(Function);
|
||||
});
|
||||
t.true(isPrimitive(null), "isPrimitive(null) is primitive");
|
||||
t.true(isPrimitive(undefined), "isPrimitive(undefined) is primitive");
|
||||
t.true(isPrimitive('string'), "isPrimitive(string) is primitive");
|
||||
t.true(isPrimitive(true), "isPrimitive(true) is primitive");
|
||||
t.true(isPrimitive(50), "isPrimitive(50) is primitive");
|
||||
t.true(isPrimitive('Hello'), "isPrimitive('Hello') is primitive");
|
||||
t.true(isPrimitive(false), "isPrimitive(false) is primitive");
|
||||
t.true(isPrimitive(Symbol()), "isPrimitive(Symbol()) is primitive");
|
||||
t.false(isPrimitive([1, 2, 3]), "isPrimitive([1, 2, 3]) is not primitive");
|
||||
t.false(isPrimitive({ a: 123 }), "isPrimitive({ a: 123 }) is not primitive");
|
||||
test('isPrimitive(null) is primitive', () => {
|
||||
expect(isPrimitive(null)).toBeTruthy()
|
||||
});
|
||||
test('isPrimitive(undefined) is primitive', () => {
|
||||
expect(isPrimitive(undefined)).toBeTruthy()
|
||||
});
|
||||
test('isPrimitive(string) is primitive', () => {
|
||||
expect(isPrimitive('string')).toBeTruthy()
|
||||
});
|
||||
test('isPrimitive(true) is primitive', () => {
|
||||
expect(isPrimitive(true)).toBeTruthy()
|
||||
});
|
||||
test('isPrimitive(50) is primitive', () => {
|
||||
expect(isPrimitive(50)).toBeTruthy()
|
||||
});
|
||||
test('isPrimitive('Hello') is primitive', () => {
|
||||
expect(isPrimitive('Hello')).toBeTruthy()
|
||||
});
|
||||
test('isPrimitive(false) is primitive', () => {
|
||||
expect(isPrimitive(false)).toBeTruthy()
|
||||
});
|
||||
test('isPrimitive(Symbol()) is primitive', () => {
|
||||
expect(isPrimitive(Symbol())).toBeTruthy()
|
||||
});
|
||||
test('isPrimitive([1, 2, 3]) is not primitive', () => {
|
||||
expect(isPrimitive([1, 2, 3])).toBeFalsy()
|
||||
});
|
||||
test('isPrimitive({ a: 123 }) is not primitive', () => {
|
||||
expect(isPrimitive({ a: 123 })).toBeFalsy()
|
||||
});
|
||||
|
||||
let start = new Date().getTime();
|
||||
isPrimitive({ a: 123
|
||||
|
||||
Reference in New Issue
Block a user