merge: added reduceRight & trim method (#961)

This commit is contained in:
Fahim Faisaal
2022-03-28 14:57:32 +06:00
committed by GitHub
parent b4fafb2479
commit 3b9af469f6
2 changed files with 19 additions and 18 deletions

View File

@ -1,12 +1,6 @@
import { reverseWords } from '../ReverseWords'
describe('reverseWords', () => {
it('expects to reverse words to return a joined word', () => {
expect(reverseWords('I Love JS')).toBe('JS Love I')
expect(reverseWords('Hello World')).toBe('World Hello')
expect(reverseWords('The Algorithms Javascript')).toBe('Javascript Algorithms The')
})
import reverseWords from '../ReverseWords'
describe('Testing the reverseWords function', () => {
it.each`
input
${123456}
@ -21,4 +15,10 @@ describe('reverseWords', () => {
}).toThrow('The given value is not a string')
}
)
it('expects to reverse words to return a joined word', () => {
expect(reverseWords('I Love JS')).toBe('JS Love I')
expect(reverseWords('Hello World')).toBe('World Hello')
expect(reverseWords('The Algorithms Javascript')).toBe('Javascript Algorithms The')
})
})