Skip to content

Instantly share code, notes, and snippets.

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
What would you like to do?
Testing the calculate function
import { assertEquals } from "";
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