mirror of
https://github.com/denoland/deno.git
synced 2025-02-02 04:38:21 -05:00
Update assertions names in std/testing README (#6318)
This commit is contained in:
parent
b86514aa7e
commit
bd26a72ab3
1 changed files with 7 additions and 6 deletions
|
@ -16,9 +16,10 @@ pretty-printed diff of failing assertion.
|
||||||
`expected` are not equal.
|
`expected` are not equal.
|
||||||
- `assertNotEquals()` - Uses the `equal` comparison and throws if the `actual`
|
- `assertNotEquals()` - Uses the `equal` comparison and throws if the `actual`
|
||||||
and `expected` are equal.
|
and `expected` are equal.
|
||||||
- `assertStrictEq()` - Compares `actual` and `expected` strictly, therefore for
|
- `assertStrictEquals()` - Compares `actual` and `expected` strictly, therefore
|
||||||
non-primitives the values must reference the same instance.
|
for non-primitives the values must reference the same instance.
|
||||||
- `assertStrContains()` - Make an assertion that `actual` contains `expected`.
|
- `assertStringContains()` - Make an assertion that `actual` contains
|
||||||
|
`expected`.
|
||||||
- `assertMatch()` - Make an assertion that `actual` match RegExp `expected`.
|
- `assertMatch()` - Make an assertion that `actual` match RegExp `expected`.
|
||||||
- `assertArrayContains()` - Make an assertion that `actual` array contains the
|
- `assertArrayContains()` - Make an assertion that `actual` array contains the
|
||||||
`expected` values.
|
`expected` values.
|
||||||
|
@ -57,20 +58,20 @@ Deno.test("example", function (): void {
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
Using `assertStrictEq()`:
|
Using `assertStrictEquals()`:
|
||||||
|
|
||||||
```ts
|
```ts
|
||||||
Deno.test("isStrictlyEqual", function (): void {
|
Deno.test("isStrictlyEqual", function (): void {
|
||||||
const a = {};
|
const a = {};
|
||||||
const b = a;
|
const b = a;
|
||||||
assertStrictEq(a, b);
|
assertStrictEquals(a, b);
|
||||||
});
|
});
|
||||||
|
|
||||||
// This test fails
|
// This test fails
|
||||||
Deno.test("isNotStrictlyEqual", function (): void {
|
Deno.test("isNotStrictlyEqual", function (): void {
|
||||||
const a = {};
|
const a = {};
|
||||||
const b = {};
|
const b = {};
|
||||||
assertStrictEq(a, b);
|
assertStrictEquals(a, b);
|
||||||
});
|
});
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue