Added tests for Strings algorithms (#390)

* test: added tests for check anagram function
This commit is contained in:
Alexandre Xavier
2020-10-04 14:38:48 -03:00
committed by GitHub
parent e156fe36a1
commit c5fc353c32
13 changed files with 8250 additions and 22 deletions

View File

@ -0,0 +1,21 @@
import { reverseWords } from './ReverseWords'
describe('reverseWords', () => {
it('expects to reverse words to return a joined word', () => {
const SUT = reverseWords('I Love JS')
expect(SUT).toBe('JS Love I')
})
it.each`
input
${123456}
${[1, 2, 3, 4, 5, 6]}
${{ test: 'test' }}
`(
'expects to throw a type error given a value that is $input',
({ input }) => {
expect(() => {
reverseWords(input)
}).toThrow('The given value is not a string')
}
)
})