Files
30-seconds-of-code/test/all/all.test.js
2018-02-14 11:46:15 +02:00

20 lines
839 B
JavaScript

const test = require('tape');
const all = require('./all.js');
test('Testing all', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof all === 'function', 'all is a Function');
t.true(all([4,1,2,3]), 'Returns true for arrays with no falsey values');
t.false(all([0,1]), 'Returns false for arrays with 0');
t.false(all([NaN,1]), 'Returns false for arrays with NaN');
t.false(all([undefined,1]), 'Returns false for arrays with undefined');
t.false(all([null,1]), 'Returns false for arrays with null');
t.false(all(['',1]), 'Returns false for arrays with empty strings');
//t.deepEqual(all(args..), 'Expected');
//t.equal(all(args..), 'Expected');
//t.false(all(args..), 'Expected');
//t.throws(all(args..), 'Expected');
t.end();
});