mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-18 09:23:55 +08:00
13 lines
352 B
JavaScript
13 lines
352 B
JavaScript
import { maxWord } from '../MaxWord'
|
|
|
|
describe('Testing the maxWord function', () => {
|
|
it('Expect throw with non string argument', () => {
|
|
expect(() => maxWord(10)).toThrow()
|
|
})
|
|
it('get the max word', () => {
|
|
const string = 'ba ba ba ba banana'
|
|
const mostOccuringWord = maxWord(string)
|
|
expect(mostOccuringWord).toBe('ba')
|
|
})
|
|
})
|