Make 03 tests pass
This commit is contained in:
parent
e2e62e1bbb
commit
e96baedad1
2 changed files with 10 additions and 4 deletions
|
@ -1,5 +1,11 @@
|
|||
const reverseString = function() {
|
||||
const reverseString = function (string) {
|
||||
let reversed = ''
|
||||
|
||||
Array.from(string).reverse().forEach(char => {
|
||||
reversed += char
|
||||
})
|
||||
|
||||
return reversed
|
||||
};
|
||||
|
||||
// Do not edit below this line
|
||||
|
|
|
@ -5,14 +5,14 @@ describe('reverseString', () => {
|
|||
expect(reverseString('hello')).toEqual('olleh');
|
||||
});
|
||||
|
||||
test.skip('reverses multiple words', () => {
|
||||
test('reverses multiple words', () => {
|
||||
expect(reverseString('hello there')).toEqual('ereht olleh')
|
||||
})
|
||||
|
||||
test.skip('works with numbers and punctuation', () => {
|
||||
test('works with numbers and punctuation', () => {
|
||||
expect(reverseString('123! abc!')).toEqual('!cba !321')
|
||||
})
|
||||
test.skip('works with blank strings', () => {
|
||||
test('works with blank strings', () => {
|
||||
expect(reverseString('')).toEqual('')
|
||||
})
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue