Tests for unionBy, unionWith

This commit is contained in:
Angelos Chalaris
2018-02-03 12:01:14 +02:00
parent 980e3e2464
commit 52cfecdc5e
3 changed files with 9 additions and 5 deletions

View File

@ -1,4 +1,4 @@
Test log for: Sat Feb 03 2018 11:58:05 GMT+0200 (GTB Standard Time)
Test log for: Sat Feb 03 2018 12:00:56 GMT+0200 (GTB Standard Time)
> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
> tape test/**/*.test.js | tap-spec
@ -1487,10 +1487,12 @@ Test log for: Sat Feb 03 2018 11:58:05 GMT+0200 (GTB Standard Time)
Testing unionBy
√ unionBy is a Function
√ Produces the appropriate results
Testing unionWith
√ unionWith is a Function
√ Produces the appropriate results
Testing uniqueElements
@ -1631,8 +1633,8 @@ Test log for: Sat Feb 03 2018 11:58:05 GMT+0200 (GTB Standard Time)
√ Works with multiple promises
total: 735
passing: 735
total: 737
passing: 737
duration: 2.4s

View File

@ -5,9 +5,10 @@ test('Testing unionBy', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof unionBy === 'function', 'unionBy is a Function');
t.deepEqual(unionBy([2.1], [1.2, 2.3], Math.floor), [2.1, 1.2], 'Produces the appropriate results');
//t.deepEqual(unionBy(args..), 'Expected');
//t.equal(unionBy(args..), 'Expected');
//t.false(unionBy(args..), 'Expected');
//t.throws(unionBy(args..), 'Expected');
t.end();
});
});

View File

@ -5,9 +5,10 @@ test('Testing unionWith', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof unionWith === 'function', 'unionWith is a Function');
t.deepEqual(unionWith([1, 1.2, 1.5, 3, 0], [1.9, 3, 0, 3.9], (a, b) => Math.round(a) === Math.round(b)), [1, 1.2, 1.5, 3, 0, 3.9], 'Produces the appropriate results');
//t.deepEqual(unionWith(args..), 'Expected');
//t.equal(unionWith(args..), 'Expected');
//t.false(unionWith(args..), 'Expected');
//t.throws(unionWith(args..), 'Expected');
t.end();
});
});