Tests for pull, pullBy, pullAtIndex, pullAtValue
This commit is contained in:
@ -5,9 +5,12 @@ test('Testing pull', (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 pull === 'function', 'pull is a Function');
|
t.true(typeof pull === 'function', 'pull is a Function');
|
||||||
|
let myArray = ['a', 'b', 'c', 'a', 'b', 'c'];
|
||||||
|
pull(myArray, 'a', 'c');
|
||||||
|
t.deepEqual(myArray, ['b','b'], 'Pulls the specified values');
|
||||||
//t.deepEqual(pull(args..), 'Expected');
|
//t.deepEqual(pull(args..), 'Expected');
|
||||||
//t.equal(pull(args..), 'Expected');
|
//t.equal(pull(args..), 'Expected');
|
||||||
//t.false(pull(args..), 'Expected');
|
//t.false(pull(args..), 'Expected');
|
||||||
//t.throws(pull(args..), 'Expected');
|
//t.throws(pull(args..), 'Expected');
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,9 +5,13 @@ test('Testing pullAtIndex', (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 pullAtIndex === 'function', 'pullAtIndex is a Function');
|
t.true(typeof pullAtIndex === 'function', 'pullAtIndex is a Function');
|
||||||
|
let myArray = ['a', 'b', 'c', 'd'];
|
||||||
|
let pulled = pullAtIndex(myArray, [1, 3]);
|
||||||
|
t.deepEqual(myArray, [ 'a', 'c' ], 'Pulls the given values');
|
||||||
|
t.deepEqual(pulled, [ 'b', 'd' ], 'Pulls the given values');
|
||||||
//t.deepEqual(pullAtIndex(args..), 'Expected');
|
//t.deepEqual(pullAtIndex(args..), 'Expected');
|
||||||
//t.equal(pullAtIndex(args..), 'Expected');
|
//t.equal(pullAtIndex(args..), 'Expected');
|
||||||
//t.false(pullAtIndex(args..), 'Expected');
|
//t.false(pullAtIndex(args..), 'Expected');
|
||||||
//t.throws(pullAtIndex(args..), 'Expected');
|
//t.throws(pullAtIndex(args..), 'Expected');
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,9 +5,13 @@ test('Testing pullAtValue', (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 pullAtValue === 'function', 'pullAtValue is a Function');
|
t.true(typeof pullAtValue === 'function', 'pullAtValue is a Function');
|
||||||
|
let myArray = ['a', 'b', 'c', 'd'];
|
||||||
|
let pulled = pullAtValue(myArray, ['b', 'd']);
|
||||||
|
t.deepEqual(myArray, [ 'a', 'c' ], 'Pulls the specified values');
|
||||||
|
t.deepEqual(pulled, [ 'b', 'd' ], 'Pulls the specified values');
|
||||||
//t.deepEqual(pullAtValue(args..), 'Expected');
|
//t.deepEqual(pullAtValue(args..), 'Expected');
|
||||||
//t.equal(pullAtValue(args..), 'Expected');
|
//t.equal(pullAtValue(args..), 'Expected');
|
||||||
//t.false(pullAtValue(args..), 'Expected');
|
//t.false(pullAtValue(args..), 'Expected');
|
||||||
//t.throws(pullAtValue(args..), 'Expected');
|
//t.throws(pullAtValue(args..), 'Expected');
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
|||||||
@ -5,9 +5,12 @@ test('Testing pullBy', (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 pullBy === 'function', 'pullBy is a Function');
|
t.true(typeof pullBy === 'function', 'pullBy is a Function');
|
||||||
|
var myArray = [{ x: 1 }, { x: 2 }, { x: 3 }, { x: 1 }];
|
||||||
|
pullBy(myArray, [{ x: 1 }, { x: 3 }], o => o.x);
|
||||||
|
t.deepEqual(myArray, [{ x: 2 }], 'Pulls the specified values');
|
||||||
//t.deepEqual(pullBy(args..), 'Expected');
|
//t.deepEqual(pullBy(args..), 'Expected');
|
||||||
//t.equal(pullBy(args..), 'Expected');
|
//t.equal(pullBy(args..), 'Expected');
|
||||||
//t.false(pullBy(args..), 'Expected');
|
//t.false(pullBy(args..), 'Expected');
|
||||||
//t.throws(pullBy(args..), 'Expected');
|
//t.throws(pullBy(args..), 'Expected');
|
||||||
t.end();
|
t.end();
|
||||||
});
|
});
|
||||||
|
|||||||
14
test/testlog
14
test/testlog
@ -1,4 +1,4 @@
|
|||||||
Test log for: Sun Feb 04 2018 20:56:18 GMT+0200 (GTB Standard Time)
|
Test log for: Sun Feb 04 2018 21:02:13 GMT+0200 (GTB Standard Time)
|
||||||
|
|
||||||
> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
|
> 30-seconds-of-code@0.0.1 test G:\My Files\git Repositories\30-seconds-of-code
|
||||||
> tape test/**/*.test.js | tap-spec
|
> tape test/**/*.test.js | tap-spec
|
||||||
@ -1144,18 +1144,24 @@ Test log for: Sun Feb 04 2018 20:56:18 GMT+0200 (GTB Standard Time)
|
|||||||
Testing pull
|
Testing pull
|
||||||
|
|
||||||
√ pull is a Function
|
√ pull is a Function
|
||||||
|
√ Pulls the specified values
|
||||||
|
|
||||||
Testing pullAtIndex
|
Testing pullAtIndex
|
||||||
|
|
||||||
√ pullAtIndex is a Function
|
√ pullAtIndex is a Function
|
||||||
|
√ Pulls the given values
|
||||||
|
√ Pulls the given values
|
||||||
|
|
||||||
Testing pullAtValue
|
Testing pullAtValue
|
||||||
|
|
||||||
√ pullAtValue is a Function
|
√ pullAtValue is a Function
|
||||||
|
√ Pulls the specified values
|
||||||
|
√ Pulls the specified values
|
||||||
|
|
||||||
Testing pullBy
|
Testing pullBy
|
||||||
|
|
||||||
√ pullBy is a Function
|
√ pullBy is a Function
|
||||||
|
√ Pulls the specified values
|
||||||
|
|
||||||
Testing quickSort
|
Testing quickSort
|
||||||
|
|
||||||
@ -1718,8 +1724,8 @@ Test log for: Sun Feb 04 2018 20:56:18 GMT+0200 (GTB Standard Time)
|
|||||||
√ Works with multiple promises
|
√ Works with multiple promises
|
||||||
|
|
||||||
|
|
||||||
total: 825
|
total: 831
|
||||||
passing: 825
|
passing: 831
|
||||||
duration: 2.4s
|
duration: 2.5s
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user