Files
classroomio/apps/dashboard/src/lib/utils/functions/course.spec.ts
T
Toyin MuhammedandRotimi Best 6d689ede45 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 <best@classroomio.com>
2023-12-20 14:28:40 +03:00

19 lines
481 B
TypeScript

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();
});
});