Skip to content

Commit 741ab00

Browse files
Replace chai.assert with node:assert/strict
1 parent 7a30af3 commit 741ab00

68 files changed

Lines changed: 187 additions & 190 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.oxlintrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,12 @@
3939
"eslint/no-restricted-imports": [
4040
"warn",
4141
{
42+
"paths": [
43+
{
44+
"name": "node:assert",
45+
"message": "Use node:assert/strict instead"
46+
}
47+
],
4248
"patterns": [
4349
{
4450
"group": ["../*/src", "../*/src/*", "../../*/src", "../../*/src/*"],
@@ -77,6 +83,7 @@
7783
"typescript/restrict-template-expressions": "off",
7884
"typescript/unbound-method": "off",
7985
"unicorn/prefer-module": "warn",
86+
"unicorn/prefer-node-protocol": "warn",
8087
"unicorn/throw-new-error": "warn"
8188
},
8289
"overrides": [

packages/app-vscode/src/ide/vscode/textLine.vscode.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as assert from "assert";
1+
import * as assert from "node:assert/strict";
22
import { getReusableEditor } from "@cursorless/lib-vscode-common";
33
import VscodeTextLine from "./VscodeTextLine";
44

packages/app-vscode/src/keyboard/buildSuffixTrie.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import assert from "node:assert";
1+
import * as assert from "node:assert/strict";
22
import type { KeyValuePair } from "./buildSuffixTrie";
33
import { buildSuffixTrie } from "./buildSuffixTrie";
44
import { isEqual, sortBy, uniq, uniqWith } from "lodash-es";
@@ -130,8 +130,8 @@ suite("buildSuffixTrie", () => {
130130
sortEntries(chars.flatMap((char) => trie.search(char))),
131131
isEqual,
132132
).map(({ key, value }) => ({ key, value }));
133-
assert.deepStrictEqual(actual, sortEntries(expected));
134-
assert.deepStrictEqual(
133+
assert.deepEqual(actual, sortEntries(expected));
134+
assert.deepEqual(
135135
sortBy(conflicts.map(sortEntries), (conflict) =>
136136
JSON.stringify(conflict),
137137
),

packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import assert from "assert";
1+
import * as assert from "node:assert/strict";
22
import nearley from "nearley";
33
import type { KeyDescriptor } from "../TokenTypeHelpers";
44
import grammar from "./generated/grammar";

packages/app-vscode/src/keyboard/grammar/grammar.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import nearley from "nearley";
22
import grammar from "./generated/grammar";
3-
import assert from "assert";
3+
import * as assert from "node:assert/strict";
44
import type { KeyDescriptor } from "../TokenTypeHelpers";
55
import type { KeyboardCommandHandler } from "../KeyboardCommandHandler";
66
import type { KeyboardCommand } from "../KeyboardCommandTypeHelpers";
@@ -189,7 +189,7 @@ suite("keyboard grammar", () => {
189189
parser.feed(tokens);
190190

191191
assert.equal(parser.results.length, 1);
192-
assert.deepStrictEqual(parser.results[0], expected);
192+
assert.deepEqual(parser.results[0], expected);
193193
});
194194
});
195195
});

packages/app-web-docs/src/docs/components/flattenHighlights.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { BorderStyle, Range } from "@cursorless/lib-common";
2-
import * as assert from "assert";
2+
import * as assert from "node:assert/strict";
33
import { flattenHighlights } from "./flattenHighlights";
44
import type { Highlight, Scope } from "./types";
55

packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocument.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as assert from "node:assert";
1+
import * as assert from "node:assert/strict";
22
import { URI } from "vscode-uri";
33
import { Position } from "../../../types/Position";
44
import { Range } from "../../../types/Range";

packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentEdit.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as assert from "node:assert";
1+
import * as assert from "node:assert/strict";
22
import { Range } from "../../../types/Range";
33
import { createTestDocument } from "./createTestDocument";
44

packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentLineAt.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { range } from "lodash-es";
2-
import * as assert from "node:assert";
2+
import * as assert from "node:assert/strict";
33
import { createTestDocument } from "./createTestDocument";
44

55
interface TestCaseFixture {

packages/lib-common/src/scopeVisualizerUtil/generateDecorationsForCharacterRange/handleMultipleLines.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import assert from "assert";
1+
import * as assert from "node:assert/strict";
22
import { map } from "itertools";
33
import { Range } from "../../types/Range";
44
import { BorderStyle } from "../decorationStyle.types";
@@ -136,7 +136,7 @@ suite("handleMultipleLines", () => {
136136
],
137137
);
138138

139-
assert.deepStrictEqual(actual, testCase.expected);
139+
assert.deepEqual(actual, testCase.expected);
140140
});
141141
}
142142
});

0 commit comments

Comments
 (0)