Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
10
test/nthElement/nthElement.test.js
Normal file
10
test/nthElement/nthElement.test.js
Normal file
@ -0,0 +1,10 @@
|
||||
const expect = require('expect');
|
||||
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.");
|
||||
|
||||
Reference in New Issue
Block a user