test: add four new test cases

This commit is contained in:
Fahim Faisaal
2022-02-17 10:31:34 +06:00
parent 6f401c9aaf
commit 4609833da1

View File

@@ -1,9 +1,19 @@
import { lower } from '../Lower'
describe('Lower', () => {
it('return uppercase strings', () => {
expect(lower('hello')).toBe('hello')
expect(lower('WORLD')).toBe('world')
expect(lower('hello_WORLD')).toBe('hello_world')
describe('Testing the Lower function', () => {
it('Test 1: Check by invalid type', () => {
expect(() => lower(345)).toThrowError();
expect(() => lower(true)).toThrowError();
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');
})
})