Test cleanup and fixes [a-b]
This commit is contained in:
@ -6,9 +6,15 @@ const nthArg = require('./nthArg.js');
|
||||
expect(nthArg).toBeInstanceOf(Function);
|
||||
});
|
||||
const third = nthArg(2);
|
||||
t.equal(third(1, 2, 3), 3, 'Returns the nth argument');
|
||||
t.equal(third(1, 2), undefined, 'Returns undefined if arguments too few');
|
||||
test('Returns the nth argument', () => {
|
||||
expect(third(1, 2, 3), 3).toBe()
|
||||
});
|
||||
test('Returns undefined if arguments too few', () => {
|
||||
expect(third(1, 2), undefined).toBe()
|
||||
});
|
||||
const last = nthArg(-1);
|
||||
t.equal(last(1, 2, 3, 4, 5), 5, 'Works for negative values');
|
||||
test('Works for negative values', () => {
|
||||
expect(last(1, 2, 3, 4, 5), 5).toBe()
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user