Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
axetroy committed Jan 22, 2025
1 parent 88cdf04 commit bf12807
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions docs/rules/consistent-assert.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,29 +14,38 @@ Prefer `assert.ok` for its explicit intent and better readability. It aligns wit
```js
import assert from 'node:assert';

assert.strictEqual(actual, expected);
assert.deepStrictEqual(actual, expected);

//
assert(true);
assert(divide(10, 2) === 5); // Inconsistent with other API styles

//
assert.ok(true);
assert.ok(divide(10, 2) === 5);
```

```js
import {strict as assert} from 'node:assert';

assert.strictEqual(actual, expected);
assert.deepStrictEqual(actual, expected);

//
assert(true);
assert(divide(10, 2) === 5); // Inconsistent with other API styles

//
assert.ok(true);
assert.ok(divide(10, 2) === 5);
```

```js
import assert from 'node:assert/strict';

assert.strictEqual(actual, expected);
assert.deepStrictEqual(actual, expected);

//
assert(true);
assert(divide(10, 2) === 5); // Inconsistent with other API styles

//
assert.ok(true);
assert.ok(divide(10, 2) === 5);
```

0 comments on commit bf12807

Please sign in to comment.