odin-js-fundamentals-part-4/03_reverseString/reverseString.spec.js

19 lines
507 B
JavaScript
Raw Normal View History

const reverseString = require('./reverseString')
describe('reverseString', () => {
test('reverses single word', () => {
expect(reverseString('hello')).toEqual('olleh');
});
2024-01-05 19:51:18 +00:00
test('reverses multiple words', () => {
expect(reverseString('hello there')).toEqual('ereht olleh')
})
2024-01-05 19:51:18 +00:00
test('works with numbers and punctuation', () => {
expect(reverseString('123! abc!')).toEqual('!cba !321')
})
2024-01-05 19:51:18 +00:00
test('works with blank strings', () => {
expect(reverseString('')).toEqual('')
})
});