mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-14 18:03:53 +08:00
13 lines
354 B
JavaScript
13 lines
354 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 mostOccurringWord = maxWord(string)
|
|
expect(mostOccurringWord).toBe('ba')
|
|
})
|
|
})
|