Migrated tests to jest
Used jest-codemods to migrate, will have to pass everything by hand before we can merge.
This commit is contained in:
@ -1,11 +0,0 @@
|
||||
const isAnagram = (str1, str2) => {
|
||||
const normalize = str =>
|
||||
str
|
||||
.toLowerCase()
|
||||
.replace(/[^a-z0-9]/gi, '')
|
||||
.split('')
|
||||
.sort()
|
||||
.join('');
|
||||
return normalize(str1) === normalize(str2);
|
||||
};
|
||||
module.exports = isAnagram;
|
||||
@ -1,17 +0,0 @@
|
||||
const test = require('tape');
|
||||
const isAnagram = require('./isAnagram.js');
|
||||
|
||||
test('Testing isAnagram', (t) => {
|
||||
//For more information on all the methods supported by tape
|
||||
//Please go to https://github.com/substack/tape
|
||||
t.true(typeof isAnagram === 'function', 'isAnagram is a Function');
|
||||
t.true(isAnagram('iceman', 'cinema'), 'Checks valid anagram');
|
||||
t.true(isAnagram('rail safety', 'fairy tales'), 'Works with spaces');
|
||||
t.true(isAnagram('roast beef', 'eat for BSE'), 'Ignores case');
|
||||
t.true(isAnagram('Regera Dowdy', 'E. G. Deadworry'), 'Ignores special characters');
|
||||
//t.deepEqual(isAnagram(args..), 'Expected');
|
||||
//t.equal(isAnagram(args..), 'Expected');
|
||||
//t.false(isAnagram(args..), 'Expected');
|
||||
//t.throws(isAnagram(args..), 'Expected');
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user