Compare commits
No commits in common. "a0ee7b94c2a899736c9ad9604c81966a72dff65b" and "a0d46f7018b7698559e2096a3a6fb80fef3bd2a8" have entirely different histories.
a0ee7b94c2
...
a0d46f7018
|
@ -27,26 +27,6 @@ export class TestContext {
|
||||||
title,
|
title,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Assert that the value is false. */
|
|
||||||
false(actual: boolean, title?: string): void {
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
|
|
||||||
if (actual === false) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new AssertionError("Failed false assertion", actual, false, title);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Assert that the value is true. */
|
|
||||||
true(actual: boolean, title?: string): void {
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-unnecessary-boolean-literal-compare
|
|
||||||
if (actual === true) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
throw new AssertionError("Failed true assertion", actual, true, title);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Special options for test cases. */
|
/** Special options for test cases. */
|
||||||
|
|
|
@ -1,19 +0,0 @@
|
||||||
import {setup} from "../source/index.js";
|
|
||||||
|
|
||||||
await setup("Assertions", async (group) => {
|
|
||||||
group.test("equals", async (test) => {
|
|
||||||
test.equals(true, true, "boolean");
|
|
||||||
test.equals(Math.PI, Math.PI, "number");
|
|
||||||
test.equals("A string!", "A string!", "string");
|
|
||||||
});
|
|
||||||
|
|
||||||
group.test("false", async (test) => {
|
|
||||||
test.false(1 < 0, "logic");
|
|
||||||
test.false(new Date() instanceof String, "instanceof");
|
|
||||||
});
|
|
||||||
|
|
||||||
group.test("true", async (test) => {
|
|
||||||
test.true(1 > 0, "logic");
|
|
||||||
test.true(new Date() instanceof Date, "instanceof");
|
|
||||||
});
|
|
||||||
});
|
|
|
@ -1,7 +1,5 @@
|
||||||
import {setup} from "../source/index.js";
|
import {setup} from "../source/index.js";
|
||||||
|
|
||||||
await import("./assertions.js");
|
|
||||||
|
|
||||||
async function add(a: number, b: number): Promise<number> {
|
async function add(a: number, b: number): Promise<number> {
|
||||||
await new Promise<void>((resolve) => {
|
await new Promise<void>((resolve) => {
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|
Loading…
Reference in New Issue