2021-10-03 17:28:17 +05:30
|
|
|
import { maxCharacter } from '../MaxCharacter'
|
2020-10-06 23:50:42 -03:00
|
|
|
|
|
|
|
|
describe('Testing the maxCharacter function', () => {
|
|
|
|
|
it('Expect throw with wrong arg', () => {
|
|
|
|
|
expect(() => maxCharacter(123)).toThrow()
|
|
|
|
|
})
|
|
|
|
|
it('Check the max character in string', () => {
|
|
|
|
|
const theString = 'I can\'t do that'
|
|
|
|
|
const maxChar = maxCharacter(theString)
|
|
|
|
|
expect(maxChar).toBe('t')
|
|
|
|
|
})
|
|
|
|
|
})
|