diff options
author | WJH <hou32hou@gmail.com> | 2020-07-03 00:03:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-02 18:03:15 +0200 |
commit | 538504f57c206cb3d10f9fd53bd0c3fc4bef4e6f (patch) | |
tree | 3bb0e6e1f4599b28aa528eecc7c4d2bb77b97341 /std/testing/asserts_test.ts | |
parent | cc12e86fe36a77ecb0bb836ba82e823ca26abdc2 (diff) |
improve(std/asserts): allow assert functions to specify type parameter (#6413)
Diffstat (limited to 'std/testing/asserts_test.ts')
-rw-r--r-- | std/testing/asserts_test.ts | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/std/testing/asserts_test.ts b/std/testing/asserts_test.ts index 5537b41e7..854cb9730 100644 --- a/std/testing/asserts_test.ts +++ b/std/testing/asserts_test.ts @@ -412,6 +412,17 @@ Deno.test({ }, }); +Deno.test({ + name: "assert* functions with specified type paratemeter", + fn(): void { + assertEquals<string>("hello", "hello"); + assertNotEquals<number>(1, 2); + assertArrayContains<boolean>([true, false], [true]); + const value = { x: 1 }; + assertStrictEquals<typeof value>(value, value); + }, +}); + Deno.test("Assert Throws Non-Error Fail", () => { assertThrows( () => { |