Skip to content

Commit 4609833

Browse files
committed
test: add four new test cases
1 parent 6f401c9 commit 4609833

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

String/test/Lower.test.js

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,19 @@
11
import { lower } from '../Lower'
22

3-
describe('Lower', () => {
4-
it('return uppercase strings', () => {
5-
expect(lower('hello')).toBe('hello')
6-
expect(lower('WORLD')).toBe('world')
7-
expect(lower('hello_WORLD')).toBe('hello_world')
3+
describe('Testing the Lower function', () => {
4+
it('Test 1: Check by invalid type', () => {
5+
expect(() => lower(345)).toThrowError();
6+
expect(() => lower(true)).toThrowError();
7+
expect(() => lower(null)).toThrowError();
8+
})
9+
10+
it('Test 2: Check by uppercase string', () => {
11+
expect(lower('WORLD')).toBe('world');
12+
expect(lower('Hello_WORLD')).toBe('hello_world');
13+
})
14+
15+
it('Test 3: Check by lowercase string', () => {
16+
expect(lower('hello')).toBe('hello');
17+
expect(lower('hello_world')).toBe('hello_world');
818
})
919
})

0 commit comments

Comments
 (0)