isPrimitive test, type, truthy/falsy, time test, message reformat
This commit is contained in:
@@ -5,17 +5,20 @@ test('Testing isPrimitive', (t) => {
|
|||||||
//For more information on all the methods supported by tape
|
//For more information on all the methods supported by tape
|
||||||
//Please go to https://github.com/substack/tape
|
//Please go to https://github.com/substack/tape
|
||||||
t.true(typeof isPrimitive === 'function', 'isPrimitive is a Function');
|
t.true(typeof isPrimitive === 'function', 'isPrimitive is a Function');
|
||||||
t.equal(isPrimitive(null), true, "passed value is primitive");
|
t.true(isPrimitive(null), "isPrimitive(null) is primitive");
|
||||||
t.equal(isPrimitive(50), true, "passed value is primitive");
|
t.true(isPrimitive(undefined), "isPrimitive(undefined) is primitive");
|
||||||
t.equal(isPrimitive('Hello'), true, "passed value is primitive");
|
t.true(isPrimitive('string'), "isPrimitive(string) is primitive");
|
||||||
t.equal(isPrimitive(false), true, "passed value is primitive");
|
t.true(isPrimitive(true), "isPrimitive(true) is primitive");
|
||||||
t.equal(isPrimitive(Symbol()), true, "passed value is primitive");
|
t.true(isPrimitive(50), "isPrimitive(50) is primitive");
|
||||||
t.equal(isPrimitive([]), false, "passed value 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.deepEqual(isPrimitive(args..), 'Expected');
|
t.false(isPrimitive([1, 2, 3]), "isPrimitive([1, 2, 3]) is not primitive");
|
||||||
//t.equal(isPrimitive(args..), 'Expected');
|
t.false(isPrimitive({ a: 123 }), "isPrimitive({ a: 123 }) is not primitive");
|
||||||
//t.false(isPrimitive(args..), 'Expected');
|
|
||||||
//t.throws(isPrimitive(args..), 'Expected');
|
let start = new Date().getTime();
|
||||||
|
isPrimitive({ a: 123 });
|
||||||
|
let end = new Date().getTime();
|
||||||
|
t.true((end - start) < 2000, 'isPrimitive({ a: 123 }) takes less than 2s to run');
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
Reference in New Issue
Block a user