Make 03 tests pass

This commit is contained in:
marleyrae 2023-06-19 15:33:46 -07:00
parent e2e62e1bbb
commit e96baedad1
2 changed files with 10 additions and 4 deletions

View file

@ -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

View file

@ -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('')
})
});