Complete the code to import Deno's testing module.
import { [1] } from "https://deno.land/std/testing/asserts.ts";
The assertEquals function is commonly used to check if two values are equal in Deno tests.
Complete the code to define a test case using Deno's built-in test function.
Deno.[1]("simple addition test", () => { const result = 2 + 3; assertEquals(result, 5); });
runTest.Deno uses the test function to define test cases.
Fix the error in the test function to properly handle async code.
Deno.test("async test", async () => { const data = await fetch("https://example.com"); const text = await data.text(); [1](text.length > 0); });
assertEquals when comparing to a boolean.assertThrows which is for error checking.For checking a condition that should be true, assertTrue is the correct assertion.
Fill both blanks to create a test that expects an error to be thrown.
Deno.test("error test", () => { [1](() => { throw new Error("fail"); }, [2]); });
assertEquals instead of assertThrows.assertThrows checks if a function throws an error, and Error specifies the expected error type.
Fill all three blanks to create a test that checks if a string includes a substring.
Deno.test("substring test", () => { const message = "Hello Deno!"; [1](message.[2]("Deno"), [3]); });
assertTrue instead of assertEquals.indexOf without comparison.assertEquals compares values, includes checks substring presence, and true is the expected boolean.
