mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
.. | ||
mod.ts | ||
README.md | ||
test.ts |
Testing
Usage
import { test, assert, equal, assertEqual } from 'https://deno.land/x/testing/testing.ts';
test({
name: 'testing example',
fn() {
assert(equal("world", "world"));
assert(!equal("hello", "world"));
assert(equal({ hello: "world" }, { hello: "world" }));
assert(!equal({ world: "hello" }, { hello: "world" }));
assertEqual("world", "world");
assertEqual({hello: "world"}, {hello: "world"});
},
});
Short syntax (named function instead of object):
test(function example() {
assert(equal("world", "world"));
assert(!equal("hello", "world"));
assert(equal({ hello: "world" }, { hello: "world" }));
assert(!equal({ world: "hello" }, { hello: "world" }));
assertEqual("world", "world");
assertEqual({hello: "world"}, {hello: "world"});
});