mirror of
https://github.com/TheAlgorithms/JavaScript.git
synced 2026-03-13 15:21:15 +08:00
test: add four new test cases
This commit is contained in:
@@ -1,9 +1,19 @@
|
|||||||
import { lower } from '../Lower'
|
import { lower } from '../Lower'
|
||||||
|
|
||||||
describe('Lower', () => {
|
describe('Testing the Lower function', () => {
|
||||||
it('return uppercase strings', () => {
|
it('Test 1: Check by invalid type', () => {
|
||||||
expect(lower('hello')).toBe('hello')
|
expect(() => lower(345)).toThrowError();
|
||||||
expect(lower('WORLD')).toBe('world')
|
expect(() => lower(true)).toThrowError();
|
||||||
expect(lower('hello_WORLD')).toBe('hello_world')
|
expect(() => lower(null)).toThrowError();
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Test 2: Check by uppercase string', () => {
|
||||||
|
expect(lower('WORLD')).toBe('world');
|
||||||
|
expect(lower('Hello_WORLD')).toBe('hello_world');
|
||||||
|
})
|
||||||
|
|
||||||
|
it('Test 3: Check by lowercase string', () => {
|
||||||
|
expect(lower('hello')).toBe('hello');
|
||||||
|
expect(lower('hello_world')).toBe('hello_world');
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user