feat: unit tests for utils (#92)

* init

* get unit test working for course.ts file

* added some other tests

* tests halfway + change config to accomodate js files

* utility functions tests done

* fix: config file + miscellaneous fixes

* fix: prepare script

* fix lock file

---------

Co-authored-by: Rotimi Best <[email protected]>
This commit is contained in:
Toyin Muhammed
2023-12-20 14:28:40 +03:00
committed by GitHub
co-authored by Rotimi Best
parent 4b2e58b1de
commit 6d689ede45
24 changed files with 2293 additions and 35 deletions
@@ -0,0 +1,18 @@
import { isCourseFree } from './course';
describe('course.ts', () => {
test('Should return True when cost is 0', () => {
const result = isCourseFree(0);
expect(result).toBeTruthy();
});
test('Should return true when cost is negative', () => {
const result = isCourseFree(-10);
expect(result).toBeTruthy();
});
test('Should return True when cost is Not A Number', () => {
const result = isCourseFree(NaN);
expect(result).toBeTruthy();
});
});