|
8 | 8 | assertMatch, |
9 | 9 | assertEquals, |
10 | 10 | assertStrictEquals, |
| 11 | + assertNotStrictEquals, |
11 | 12 | assertThrows, |
12 | 13 | assertThrowsAsync, |
13 | 14 | AssertionError, |
@@ -463,13 +464,42 @@ Deno.test({ |
463 | 464 | }); |
464 | 465 |
|
465 | 466 | Deno.test({ |
466 | | - name: "assert* functions with specified type paratemeter", |
| 467 | + name: "strictly unequal pass case", |
| 468 | + fn(): void { |
| 469 | + assertNotStrictEquals(true, false); |
| 470 | + assertNotStrictEquals(10, 11); |
| 471 | + assertNotStrictEquals("abc", "xyz"); |
| 472 | + assertNotStrictEquals(1, "1"); |
| 473 | + |
| 474 | + const xs = [1, false, "foo"]; |
| 475 | + const ys = [1, true, "bar"]; |
| 476 | + assertNotStrictEquals(xs, ys); |
| 477 | + |
| 478 | + const x = { a: 1 }; |
| 479 | + const y = { a: 2 }; |
| 480 | + assertNotStrictEquals(x, y); |
| 481 | + }, |
| 482 | +}); |
| 483 | + |
| 484 | +Deno.test({ |
| 485 | + name: "strictly unequal fail case", |
| 486 | + fn(): void { |
| 487 | + assertThrows( |
| 488 | + () => assertNotStrictEquals(1, 1), |
| 489 | + AssertionError, |
| 490 | + ); |
| 491 | + }, |
| 492 | +}); |
| 493 | + |
| 494 | +Deno.test({ |
| 495 | + name: "assert* functions with specified type parameter", |
467 | 496 | fn(): void { |
468 | 497 | assertEquals<string>("hello", "hello"); |
469 | 498 | assertNotEquals<number>(1, 2); |
470 | 499 | assertArrayContains<boolean>([true, false], [true]); |
471 | 500 | const value = { x: 1 }; |
472 | 501 | assertStrictEquals<typeof value>(value, value); |
| 502 | + assertNotStrictEquals<object>(value, { x: 1 }); |
473 | 503 | }, |
474 | 504 | }); |
475 | 505 |
|
|
0 commit comments