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:
co-authored by
Rotimi Best
parent
4b2e58b1de
commit
6d689ede45
@@ -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();
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user