mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2025-07-05 16:26:47 +08:00
24 lines
636 B
JavaScript
24 lines
636 B
JavaScript
import { CheckPascalCase } from '../CheckPascalCase'
|
|
|
|
test('CheckPascalCase(TheAlgorithms) -> true', () => {
|
|
const word = 'TheAlgorithms'
|
|
const res = CheckPascalCase(word)
|
|
expect(res).toBeTruthy()
|
|
})
|
|
|
|
test('CheckPascalCase(theAlgorithms) -> false', () => {
|
|
const word = 'theAlgorithms'
|
|
const res = CheckPascalCase(word)
|
|
expect(res).toBeFalsy()
|
|
})
|
|
|
|
test('CheckPascalCase(The Algorithms) -> false', () => {
|
|
const word = 'The Algorithms'
|
|
const res = CheckPascalCase(word)
|
|
expect(res).toBeFalsy()
|
|
})
|
|
|
|
test('CheckPascalCase throws when input is not a string', () => {
|
|
expect(() => CheckPascalCase(100)).toThrowError()
|
|
})
|