mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-07 02:05:08 +08:00
15 lines
519 B
JavaScript
15 lines
519 B
JavaScript
import { countNumberWordLength } from '../Problem017.js'
|
|
|
|
describe('Number letter count', () => {
|
|
test.each([[5, 19], [100, 864], [1000, 21124]])('Number letter count from 1 to %i', (n, expected) => {
|
|
expect(countNumberWordLength(n)).toBe(expected)
|
|
})
|
|
|
|
test.each([
|
|
['test', 'Invalid input, please provide valid number'],
|
|
[0, 'Please provide number greater that 1']
|
|
])('Should throw an error for input %i', (n, expected) => {
|
|
expect(() => countNumberWordLength(n)).toThrowError(expected)
|
|
})
|
|
})
|