Created
November 22, 2019 11:27
-
-
Save crookse/ed2d78fdd1b1a3a24ac98972b6ab5687 to your computer and use it in GitHub Desktop.
Deno Standard Modules - Testing: Basic Usage
This file contains 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 { runTests, test } from "https://deno.land/std/testing/mod.ts"; | |
import { assertEquals } from "https://deno.land/std/testing/asserts.ts"; | |
// Write a named test where the "name" field's value is the name of the test | |
// (The name of this test is "testing example") | |
test({ | |
name: "testing example", | |
fn(): void { | |
assertEquals("world", "world"); | |
assertEquals({ hello: "world" }, { hello: "world" }); | |
} | |
}); | |
// Write a named test where the name of the function is the name of the test | |
// (The name of this test is "example") | |
test(function example(): void { | |
assertEquals("world", "world"); | |
assertEquals({ hello: "world" }, { hello: "world" }); | |
}); | |
runTests(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment