Updated the test system
This commit is contained in:
12
test/nthElement.test.js
Normal file
12
test/nthElement.test.js
Normal file
@ -0,0 +1,12 @@
|
||||
const expect = require('expect');
|
||||
const {nthElement} = require('./_30s.js');
|
||||
|
||||
test('nthElement is a Function', () => {
|
||||
expect(nthElement).toBeInstanceOf(Function);
|
||||
});
|
||||
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