Complete the code to import the assertion module from Deno's standard library.
import { assertEquals } from "[1]";
The assertEquals function is imported from Deno's standard testing asserts module.
Complete the code to write a test function using Deno's test API.
Deno.test("example test", () => { [1](1 + 1, 2); });
assertThrows which is for error checking.assertNotEquals which checks inequality.assertEquals checks if two values are equal, perfect for this test.
Fix the error in the test to correctly check that a function throws an error.
Deno.test("throws error", () => { [1](() => { throw new Error("fail"); }); });
assertEquals which compares values, not errors.assert which only checks truthiness.assertThrows is used to check if a function throws an error as expected.
Fill both blanks to create a test that checks if a string contains a substring.
Deno.test("string contains", () => { const text = "hello world"; [1](text.includes("world"), [2]); });
assert which only checks truthiness without expected value.false as expected value which is incorrect here.assertEquals checks if the expression equals the expected value, which is true because 'world' is in the string.
Fill all three blanks to write a test that verifies an array length and contents.
Deno.test("array test", () => { const arr = [1, 2, 3]; [1](arr.length, [2]); [3](arr.includes(2)); });
assertNotEquals which checks for inequality.assertEquals checks the length is 3, and assert checks that 2 is included in the array.
