Created
July 23, 2021 13:11
-
-
Save minnacaptain/0236d947cebaab73246a9ff9cea262e7 to your computer and use it in GitHub Desktop.
Testing the calculate function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { assertEquals } from "https://deno.land/std@0.102.0/testing/asserts.ts"; | |
import { calculateAverageScore } from './calculate.ts' | |
const mockGetContent = () => Promise.resolve( | |
"student_name,horoscope,exam_name,exam_score,feedback_score,would_recommend\n" + | |
"Braylen Natalia,Gemini,AWS Certified Cloud Practitioner,1,4.26,Yes\n" + | |
"Kash Macey,Leo,AWS Certified SysOps Administrator,2,3.04,Yes\n" + | |
"Erica Daniela,Sagittarius,AWS Certified Cloud Practitioner,3,7.61,Yes" | |
) | |
Deno.test("calculate", async () => { | |
const score = await calculateAverageScore(mockGetContent) | |
assertEquals(score, 2); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment