Skip to content

Commit 3d2cf21

Browse files
committed
test[assert]: add message test for anonymous predicate
1 parent 10e6391 commit 3d2cf21

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

assert_test.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,17 @@ Deno.test("assert", async (t) => {
2929
);
3030
});
3131

32+
await t.step(
33+
"throws an `AssertError` on false predicate with an anonymous predicate",
34+
() => {
35+
assertThrows(
36+
() => assert(x, (_x: unknown): _x is string => false),
37+
AssertError,
38+
`Expected a value that satisfies the predicate anonymous predicate, got symbol: undefined`,
39+
);
40+
},
41+
);
42+
3243
await t.step(
3344
"throws an `AssertError` on false predicate with a custom name",
3445
() => {

0 commit comments

Comments
 (0)