mirror of
https://github.com/10h30/odin-javascript-exercises.git
synced 2026-06-05 15:09:09 +09:00
21 lines
567 B
JavaScript
21 lines
567 B
JavaScript
const reverseString = require('./reverseString-solution');
|
|
|
|
describe('reverseString', () => {
|
|
test('reverses single word', () => {
|
|
expect(reverseString('hello')).toEqual('olleh');
|
|
});
|
|
|
|
test('reverses multiple words', () => {
|
|
expect(reverseString('hello there')).toEqual('ereht olleh');
|
|
});
|
|
|
|
test('works with numbers and punctuation', () => {
|
|
expect(reverseString('123! abc! Hello, Odinite.')).toEqual(
|
|
'.etinidO ,olleH !cba !321'
|
|
);
|
|
});
|
|
test('works with blank strings', () => {
|
|
expect(reverseString('')).toEqual('');
|
|
});
|
|
});
|