Test cleanup and fixes [c-d]
This commit is contained in:
@ -5,6 +5,10 @@ const nthElement = require('./nthElement.js');
|
||||
test('nthElement is a Function', () => {
|
||||
expect(nthElement).toBeInstanceOf(Function);
|
||||
});
|
||||
t.equal(nthElement(['a', 'b', 'c'], 1), 'b', "Returns the nth element of an array.");
|
||||
t.equal(nthElement(['a', 'b', 'c'], -3), 'a', "Returns the nth element of an array.");
|
||||
test('Returns the nth element of an array.', () => {
|
||||
expect(nthElement(['a', 'b', 'c'], 1)).toBe('b')
|
||||
});
|
||||
test('Returns the nth element of an array.', () => {
|
||||
expect(nthElement(['a', 'b', 'c'], -3)).toBe('a')
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user