Test cleanup and fixes [c-d]
This commit is contained in:
@ -5,8 +5,14 @@ const stringPermutations = require('./stringPermutations.js');
|
||||
test('stringPermutations is a Function', () => {
|
||||
expect(stringPermutations).toBeInstanceOf(Function);
|
||||
});
|
||||
t.deepEqual(stringPermutations('abc'), ['abc','acb','bac','bca','cab','cba'], "Generates all stringPermutations of a string");
|
||||
t.deepEqual(stringPermutations('a'), ['a'], "Works for single-letter strings");
|
||||
t.deepEqual(stringPermutations(''), [''], "Works for empty strings");
|
||||
test('Generates all stringPermutations of a string', () => {
|
||||
expect(stringPermutations('abc'), ['abc','acb','bac','bca','cab').toEqual('cba'])
|
||||
});
|
||||
test('Works for single-letter strings', () => {
|
||||
expect(stringPermutations('a')).toEqual(['a'])
|
||||
});
|
||||
test('Works for empty strings', () => {
|
||||
expect(stringPermutations('')).toEqual([''])
|
||||
});
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user