Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
5
test/isSimilar/isSimilar.js
Normal file
5
test/isSimilar/isSimilar.js
Normal file
@ -0,0 +1,5 @@
|
||||
const isSimilar = (pattern, str) =>
|
||||
[...str].reduce(
|
||||
(matchIndex, char) => char.toLowerCase() === (pattern[matchIndex] || '').toLowerCase() ? matchIndex + 1 : matchIndex, 0
|
||||
) === pattern.length ? true : false;
|
||||
module.exports = isSimilar;
|
||||
8
test/isSimilar/isSimilar.test.js
Normal file
8
test/isSimilar/isSimilar.test.js
Normal file
@ -0,0 +1,8 @@
|
||||
const expect = require('expect');
|
||||
const isSimilar = require('./isSimilar.js');
|
||||
|
||||
|
||||
test('isSimilar is a Function', () => {
|
||||
expect(isSimilar).toBeInstanceOf(Function);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user