Tests for symmetricDifferenceBy, symmetricDifferenceWith

This commit is contained in:
Angelos Chalaris
2018-02-03 12:20:15 +02:00
parent 185fef6ec2
commit 5725d9a045
3 changed files with 13 additions and 5 deletions

View File

@ -5,9 +5,10 @@ test('Testing symmetricDifferenceBy', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof symmetricDifferenceBy === 'function', 'symmetricDifferenceBy is a Function');
t.deepEqual(symmetricDifferenceBy([2.1, 1.2], [2.3, 3.4], Math.floor), [ 1.2, 3.4 ], 'Returns the symmetric difference between two arrays, after applying the provided function to each array element of both');
//t.deepEqual(symmetricDifferenceBy(args..), 'Expected');
//t.equal(symmetricDifferenceBy(args..), 'Expected');
//t.false(symmetricDifferenceBy(args..), 'Expected');
//t.throws(symmetricDifferenceBy(args..), 'Expected');
t.end();
});
});

View File

@ -5,9 +5,14 @@ test('Testing symmetricDifferenceWith', (t) => {
//For more information on all the methods supported by tape
//Please go to https://github.com/substack/tape
t.true(typeof symmetricDifferenceWith === 'function', 'symmetricDifferenceWith is a Function');
t.deepEqual(symmetricDifferenceWith(
[1, 1.2, 1.5, 3, 0],
[1.9, 3, 0, 3.9],
(a, b) => Math.round(a) === Math.round(b)
), [1, 1.2, 3.9], 'Returns the symmetric difference between two arrays, using a provided function as a comparator');
//t.deepEqual(symmetricDifferenceWith(args..), 'Expected');
//t.equal(symmetricDifferenceWith(args..), 'Expected');
//t.false(symmetricDifferenceWith(args..), 'Expected');
//t.throws(symmetricDifferenceWith(args..), 'Expected');
t.end();
});
});

View File

@ -1,4 +1,4 @@
Test log for: Sat Feb 03 2018 12:17:47 GMT+0200 (GTB Standard Time)
Test log for: Sat Feb 03 2018 12:19:55 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
@ -1320,10 +1320,12 @@ Test log for: Sat Feb 03 2018 12:17:47 GMT+0200 (GTB Standard Time)
Testing symmetricDifferenceBy
√ symmetricDifferenceBy is a Function
√ Returns the symmetric difference between two arrays, after applying the provided function to each array element of both
Testing symmetricDifferenceWith
√ symmetricDifferenceWith is a Function
√ Returns the symmetric difference between two arrays, using a provided function as a comparator
Testing tail
@ -1639,8 +1641,8 @@ Test log for: Sat Feb 03 2018 12:17:47 GMT+0200 (GTB Standard Time)
√ Works with multiple promises
total: 743
passing: 743
total: 745
passing: 745
duration: 2.4s