2021-03-03 02:25:29 +00:00
|
|
|
const expect = require('expect');const reverseString = require('./reverseString')
|
2017-08-17 21:19:17 +00:00
|
|
|
|
2017-12-29 12:52:53 +00:00
|
|
|
describe('reverseString', function() {
|
2017-08-17 21:19:17 +00:00
|
|
|
it('reverses single word', function() {
|
|
|
|
expect(reverseString('hello')).toEqual('olleh');
|
|
|
|
});
|
|
|
|
|
2017-12-15 18:56:14 +00:00
|
|
|
it('reverses multiple words', function() {
|
2017-08-17 21:19:17 +00:00
|
|
|
expect(reverseString('hello there')).toEqual('ereht olleh')
|
|
|
|
})
|
|
|
|
|
2017-12-15 18:56:14 +00:00
|
|
|
it('works with numbers and punctuation', function() {
|
2017-08-17 21:19:17 +00:00
|
|
|
expect(reverseString('123! abc!')).toEqual('!cba !321')
|
|
|
|
})
|
2018-08-07 10:23:28 +00:00
|
|
|
});
|