update description for isPrimitive, add 2 tests, isPrimitive & isPrime
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
### isPrimitive
|
||||
|
||||
Returns a boolean determining if the supplied value is primitive or not.
|
||||
Returns a boolean determining if the passed value is primitive or not.
|
||||
|
||||
Use `Array.includes()` on an array of type strings which are not primitive,
|
||||
supplying the type using `typeof`.
|
||||
|
||||
@ -5,6 +5,7 @@ test('Testing isPrime', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof isPrime === 'function', 'isPrime is a Function');
|
||||
t.equal(isPrime(11), true, "passed number is a prime");
|
||||
//t.deepEqual(isPrime(args..), 'Expected');
|
||||
//t.equal(isPrime(args..), 'Expected');
|
||||
//t.false(isPrime(args..), 'Expected');
|
||||
|
||||
@ -5,6 +5,14 @@ test('Testing isPrimitive', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof isPrimitive === 'function', 'isPrimitive is a Function');
|
||||
t.equal(isPrimitive(null), true, "passed value is primitive");
|
||||
t.equal(isPrimitive(50), true, "passed value is primitive");
|
||||
t.equal(isPrimitive('Hello'), true, "passed value is primitive");
|
||||
t.equal(isPrimitive(false), true, "passed value is primitive");
|
||||
t.equal(isPrimitive(Symbol()), true, "passed value is primitive");
|
||||
t.equal(isPrimitive([]), false, "passed value is primitive");
|
||||
|
||||
|
||||
//t.deepEqual(isPrimitive(args..), 'Expected');
|
||||
//t.equal(isPrimitive(args..), 'Expected');
|
||||
//t.false(isPrimitive(args..), 'Expected');
|
||||
|
||||
Reference in New Issue
Block a user