exercise 03 completed
This commit is contained in:
parent
0e8b5f3db3
commit
0c4553b3b7
|
@ -1,5 +1,5 @@
|
|||
const reverseString = function() {
|
||||
|
||||
const reverseString = function (str) {
|
||||
return str.split('').reverse().join('');
|
||||
};
|
||||
|
||||
// Do not edit below this line
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
const reverseString = require('./reverseString')
|
||||
const reverseString = require('./reverseString');
|
||||
|
||||
describe('reverseString', () => {
|
||||
test('reverses single word', () => {
|
||||
expect(reverseString('hello')).toEqual('olleh');
|
||||
});
|
||||
test('reverses single word', () => {
|
||||
expect(reverseString('hello')).toEqual('olleh');
|
||||
});
|
||||
|
||||
test.skip('reverses multiple words', () => {
|
||||
expect(reverseString('hello there')).toEqual('ereht olleh')
|
||||
})
|
||||
test('reverses multiple words', () => {
|
||||
expect(reverseString('hello there')).toEqual('ereht olleh');
|
||||
});
|
||||
|
||||
test.skip('works with numbers and punctuation', () => {
|
||||
expect(reverseString('123! abc!')).toEqual('!cba !321')
|
||||
})
|
||||
test.skip('works with blank strings', () => {
|
||||
expect(reverseString('')).toEqual('')
|
||||
})
|
||||
test('works with numbers and punctuation', () => {
|
||||
expect(reverseString('123! abc!')).toEqual('!cba !321');
|
||||
});
|
||||
test('works with blank strings', () => {
|
||||
expect(reverseString('')).toEqual('');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue