Skip to content

Instantly share code, notes, and snippets.

@minnacaptain
Created July 23, 2021 13:11
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Testing the calculate function
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