Test migration to jest by hand
Apparently using regular expressions is way easier.
This commit is contained in:
2
test/sortCharactersInString/sortCharactersInString.js
Normal file
2
test/sortCharactersInString/sortCharactersInString.js
Normal file
@ -0,0 +1,2 @@
|
||||
const sortCharactersInString = str => [...str].sort((a, b) => a.localeCompare(b)).join('');
|
||||
module.exports = sortCharactersInString;
|
||||
@ -0,0 +1,9 @@
|
||||
const expect = require('expect');
|
||||
const sortCharactersInString = require('./sortCharactersInString.js');
|
||||
|
||||
|
||||
test('sortCharactersInString is a Function', () => {
|
||||
expect(sortCharactersInString).toBeInstanceOf(Function);
|
||||
});
|
||||
t.equal(sortCharactersInString('cabbage'), 'aabbceg', "Alphabetically sorts the characters in a string.");
|
||||
|
||||
Reference in New Issue
Block a user