diff --git a/.oxlintrc.json b/.oxlintrc.json index 85e32d4985..1f94a614e6 100644 --- a/.oxlintrc.json +++ b/.oxlintrc.json @@ -39,6 +39,12 @@ "eslint/no-restricted-imports": [ "warn", { + "paths": [ + { + "name": "node:assert", + "message": "Use node:assert/strict instead" + } + ], "patterns": [ { "group": ["../*/src", "../*/src/*", "../../*/src", "../../*/src/*"], @@ -77,6 +83,7 @@ "typescript/restrict-template-expressions": "off", "typescript/unbound-method": "off", "unicorn/prefer-module": "warn", + "unicorn/prefer-node-protocol": "warn", "unicorn/throw-new-error": "warn" }, "overrides": [ diff --git a/packages/app-vscode/src/createVscodeIde.ts b/packages/app-vscode/src/createVscodeIde.ts index 4bac4e9718..75762be8d5 100644 --- a/packages/app-vscode/src/createVscodeIde.ts +++ b/packages/app-vscode/src/createVscodeIde.ts @@ -1,4 +1,4 @@ -import * as crypto from "crypto"; +import * as crypto from "node:crypto"; import * as os from "node:os"; import * as path from "node:path"; import type { ExtensionContext } from "vscode"; diff --git a/packages/app-vscode/src/ide/vscode/textLine.vscode.test.ts b/packages/app-vscode/src/ide/vscode/textLine.vscode.test.ts index fbd11bff0d..afd1cafd32 100644 --- a/packages/app-vscode/src/ide/vscode/textLine.vscode.test.ts +++ b/packages/app-vscode/src/ide/vscode/textLine.vscode.test.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { getReusableEditor } from "@cursorless/lib-vscode-common"; import VscodeTextLine from "./VscodeTextLine"; diff --git a/packages/app-vscode/src/keyboard/buildSuffixTrie.test.ts b/packages/app-vscode/src/keyboard/buildSuffixTrie.test.ts index 6c2d27af92..6e93313a1c 100644 --- a/packages/app-vscode/src/keyboard/buildSuffixTrie.test.ts +++ b/packages/app-vscode/src/keyboard/buildSuffixTrie.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import type { KeyValuePair } from "./buildSuffixTrie"; import { buildSuffixTrie } from "./buildSuffixTrie"; import { isEqual, sortBy, uniq, uniqWith } from "lodash-es"; @@ -130,8 +130,8 @@ suite("buildSuffixTrie", () => { sortEntries(chars.flatMap((char) => trie.search(char))), isEqual, ).map(({ key, value }) => ({ key, value })); - assert.deepStrictEqual(actual, sortEntries(expected)); - assert.deepStrictEqual( + assert.deepEqual(actual, sortEntries(expected)); + assert.deepEqual( sortBy(conflicts.map(sortEntries), (conflict) => JSON.stringify(conflict), ), diff --git a/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts b/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts index b0639fcf7a..f7a837df7d 100644 --- a/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts +++ b/packages/app-vscode/src/keyboard/grammar/getAcceptableTokenTypes.test.ts @@ -1,4 +1,4 @@ -import assert from "assert"; +import * as assert from "node:assert/strict"; import nearley from "nearley"; import type { KeyDescriptor } from "../TokenTypeHelpers"; import grammar from "./generated/grammar"; @@ -153,7 +153,7 @@ suite("keyboard.getAcceptableTokenTypes", () => { arg: value.partialArg, }, }; - assert( + assert.ok( candidates.some((result) => isEqual(result, fullValue)), "Relevant candidates (note that symbols will be missing):\n" + JSON.stringify(candidates, null, 2), diff --git a/packages/app-vscode/src/keyboard/grammar/grammar.test.ts b/packages/app-vscode/src/keyboard/grammar/grammar.test.ts index 7400bab608..c5e649e6f1 100644 --- a/packages/app-vscode/src/keyboard/grammar/grammar.test.ts +++ b/packages/app-vscode/src/keyboard/grammar/grammar.test.ts @@ -1,6 +1,6 @@ import nearley from "nearley"; import grammar from "./generated/grammar"; -import assert from "assert"; +import * as assert from "node:assert/strict"; import type { KeyDescriptor } from "../TokenTypeHelpers"; import type { KeyboardCommandHandler } from "../KeyboardCommandHandler"; import type { KeyboardCommand } from "../KeyboardCommandTypeHelpers"; @@ -189,7 +189,7 @@ suite("keyboard grammar", () => { parser.feed(tokens); assert.equal(parser.results.length, 1); - assert.deepStrictEqual(parser.results[0], expected); + assert.deepEqual(parser.results[0], expected); }); }); }); diff --git a/packages/app-vscode/src/scripts/initLaunchSandbox.ts b/packages/app-vscode/src/scripts/initLaunchSandbox.ts index d1a99eb842..0ff3ae4476 100644 --- a/packages/app-vscode/src/scripts/initLaunchSandbox.ts +++ b/packages/app-vscode/src/scripts/initLaunchSandbox.ts @@ -4,7 +4,7 @@ * developing the Cursorless VSCode extension locally. */ import { extensionDependencies } from "@cursorless/lib-common"; -import * as cp from "child_process"; +import * as cp from "node:child_process"; const vsCodeToolName: string = "code"; const validCliToolParams: Array = ["--code", "--codium"]; diff --git a/packages/app-vscode/src/scripts/populateDist/runCommand.ts b/packages/app-vscode/src/scripts/populateDist/runCommand.ts index 937e04bcd3..37ef98c874 100644 --- a/packages/app-vscode/src/scripts/populateDist/runCommand.ts +++ b/packages/app-vscode/src/scripts/populateDist/runCommand.ts @@ -1,5 +1,5 @@ -import { exec } from "child_process"; -import { promisify } from "util"; +import { exec } from "node:child_process"; +import { promisify } from "node:util"; const execAsync = promisify(exec); diff --git a/packages/app-web-docs/docusaurus.config.mts b/packages/app-web-docs/docusaurus.config.mts index e27c15693f..5d978035ac 100644 --- a/packages/app-web-docs/docusaurus.config.mts +++ b/packages/app-web-docs/docusaurus.config.mts @@ -2,7 +2,7 @@ import type { Config } from "@docusaurus/types"; import type { Root } from "mdast"; import { createRequire } from "node:module"; import { fileURLToPath } from "node:url"; -import { dirname, extname, relative, resolve } from "path"; +import { dirname, extname, relative, resolve } from "node:path"; import { themes } from "prism-react-renderer"; import type { Transformer } from "unified"; import { visit } from "unist-util-visit"; diff --git a/packages/app-web-docs/src/docs/components/flattenHighlights.test.ts b/packages/app-web-docs/src/docs/components/flattenHighlights.test.ts index 0c6a849119..8f5e426625 100644 --- a/packages/app-web-docs/src/docs/components/flattenHighlights.test.ts +++ b/packages/app-web-docs/src/docs/components/flattenHighlights.test.ts @@ -1,5 +1,5 @@ import { BorderStyle, Range } from "@cursorless/lib-common"; -import * as assert from "node:assert"; +import * as assert from "node:assert/strict"; import { flattenHighlights } from "./flattenHighlights"; import type { Highlight, Scope } from "./types"; diff --git a/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocument.test.ts b/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocument.test.ts index acdb144065..f710101fd5 100644 --- a/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocument.test.ts +++ b/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocument.test.ts @@ -1,4 +1,4 @@ -import * as assert from "node:assert"; +import * as assert from "node:assert/strict"; import { URI } from "vscode-uri"; import { Position } from "../../../types/Position"; import { Range } from "../../../types/Range"; @@ -73,7 +73,7 @@ suite("InMemoryTextDocument", () => { test("positionAt", () => { const document = createTestDocument("hello \n world\r\n"); - assert.equal(document.positionAt(-1), "0:0"); + assert.equal(document.positionAt(-1).toString(), "0:0"); assert.equal(document.positionAt(0).toString(), "0:0"); assert.equal(document.positionAt(6).toString(), "0:6"); assert.equal(document.positionAt(7).toString(), "0:7"); diff --git a/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentEdit.test.ts b/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentEdit.test.ts index b63e98c75d..51a71535e8 100644 --- a/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentEdit.test.ts +++ b/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentEdit.test.ts @@ -1,4 +1,4 @@ -import * as assert from "node:assert"; +import * as assert from "node:assert/strict"; import { Range } from "../../../types/Range"; import { createTestDocument } from "./createTestDocument"; diff --git a/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentLineAt.test.ts b/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentLineAt.test.ts index f77e1b9cee..7a7bd3664d 100644 --- a/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentLineAt.test.ts +++ b/packages/lib-common/src/ide/inMemoryTextEditor/test/InMemoryTextDocumentLineAt.test.ts @@ -1,5 +1,5 @@ import { range } from "lodash-es"; -import * as assert from "node:assert"; +import * as assert from "node:assert/strict"; import { createTestDocument } from "./createTestDocument"; interface TestCaseFixture { diff --git a/packages/lib-common/src/scopeVisualizerUtil/generateDecorationsForCharacterRange/handleMultipleLines.test.ts b/packages/lib-common/src/scopeVisualizerUtil/generateDecorationsForCharacterRange/handleMultipleLines.test.ts index 62e31a5ef9..2839720468 100644 --- a/packages/lib-common/src/scopeVisualizerUtil/generateDecorationsForCharacterRange/handleMultipleLines.test.ts +++ b/packages/lib-common/src/scopeVisualizerUtil/generateDecorationsForCharacterRange/handleMultipleLines.test.ts @@ -1,4 +1,4 @@ -import assert from "assert"; +import * as assert from "node:assert/strict"; import { map } from "itertools"; import { Range } from "../../types/Range"; import { BorderStyle } from "../decorationStyle.types"; @@ -136,7 +136,7 @@ suite("handleMultipleLines", () => { ], ); - assert.deepStrictEqual(actual, testCase.expected); + assert.deepEqual(actual, testCase.expected); }); } }); diff --git a/packages/lib-common/src/testUtil/serialize.ts b/packages/lib-common/src/testUtil/serialize.ts index 3a9f24cc86..328cb16955 100644 --- a/packages/lib-common/src/testUtil/serialize.ts +++ b/packages/lib-common/src/testUtil/serialize.ts @@ -10,7 +10,7 @@ class CustomDump { private readonly opts: yaml.DumpOptions, ) {} - represent() { + represent(): string { let result = yaml.dump( this.data, Object.assign({ replacer, schema }, this.opts), @@ -35,7 +35,7 @@ const schema = yaml.DEFAULT_SCHEMA.extend({ implicit: [customDumpType] }); const isObject = (value: unknown): value is object => typeof value === "object" && value != null; -function hasSimpleChildren(value: unknown) { +function hasSimpleChildren(value: unknown): boolean { if (isObject(value)) { return Object.values(value).every( (value) => !isObject(value) && !Array.isArray(value), @@ -44,9 +44,10 @@ function hasSimpleChildren(value: unknown) { if (Array.isArray(value)) { return value.every((value) => !isObject(value) && !Array.isArray(value)); } + return false; } -function replacer(key: string, value: unknown) { +function replacer(key: string, value: unknown): unknown { if (key === "") { return value; } // top-level, don't change this @@ -58,6 +59,9 @@ function replacer(key: string, value: unknown) { return value; // default } -export const serialize = (obj: unknown) => - new CustomDump(obj, { noRefs: true, quotingType: '"' }).represent().trim() + - "\n"; +export function serialize(obj: unknown): string { + return ( + new CustomDump(obj, { noRefs: true, quotingType: '"' }).represent().trim() + + "\n" + ); +} diff --git a/packages/lib-common/src/types/generalizedRangeContains.test.ts b/packages/lib-common/src/types/generalizedRangeContains.test.ts index 56475874b8..19c7f11d9b 100644 --- a/packages/lib-common/src/types/generalizedRangeContains.test.ts +++ b/packages/lib-common/src/types/generalizedRangeContains.test.ts @@ -1,10 +1,10 @@ -import assert from "assert"; +import * as assert from "node:assert/strict"; import { generalizedRangeContains } from "./GeneralizedRange"; import { Position } from "./Position"; suite("generalizedRangeContains", () => { test("character", () => { - assert.strictEqual( + assert.equal( generalizedRangeContains( { type: "character", @@ -19,7 +19,7 @@ suite("generalizedRangeContains", () => { ), true, ); - assert.strictEqual( + assert.equal( generalizedRangeContains( { type: "character", @@ -34,7 +34,7 @@ suite("generalizedRangeContains", () => { ), true, ); - assert.strictEqual( + assert.equal( generalizedRangeContains( { type: "character", @@ -52,7 +52,7 @@ suite("generalizedRangeContains", () => { }); test("line", () => { - assert.strictEqual( + assert.equal( generalizedRangeContains( { type: "line", @@ -67,7 +67,7 @@ suite("generalizedRangeContains", () => { ), true, ); - assert.strictEqual( + assert.equal( generalizedRangeContains( { type: "line", @@ -82,7 +82,7 @@ suite("generalizedRangeContains", () => { ), true, ); - assert.strictEqual( + assert.equal( generalizedRangeContains( { type: "line", @@ -100,7 +100,7 @@ suite("generalizedRangeContains", () => { }); test("mixed", () => { - assert.strictEqual( + assert.equal( generalizedRangeContains( { type: "line", @@ -115,7 +115,7 @@ suite("generalizedRangeContains", () => { ), true, ); - assert.strictEqual( + assert.equal( generalizedRangeContains( { type: "line", @@ -130,7 +130,7 @@ suite("generalizedRangeContains", () => { ), false, ); - assert.strictEqual( + assert.equal( generalizedRangeContains( { type: "character", @@ -145,7 +145,7 @@ suite("generalizedRangeContains", () => { ), true, ); - assert.strictEqual( + assert.equal( generalizedRangeContains( { type: "character", diff --git a/packages/lib-common/src/types/generalizedRangeTouches.test.ts b/packages/lib-common/src/types/generalizedRangeTouches.test.ts index a3622a5ed0..562577abda 100644 --- a/packages/lib-common/src/types/generalizedRangeTouches.test.ts +++ b/packages/lib-common/src/types/generalizedRangeTouches.test.ts @@ -1,4 +1,4 @@ -import assert from "assert"; +import * as assert from "node:assert/strict"; import type { GeneralizedRange } from "./GeneralizedRange"; import { generalizedRangeTouches } from "./GeneralizedRange"; import { Position } from "./Position"; @@ -136,6 +136,6 @@ function testRangePair( b: GeneralizedRange, expected: boolean, ) { - assert.strictEqual(generalizedRangeTouches(a, b), expected); - assert.strictEqual(generalizedRangeTouches(b, a), expected); + assert.equal(generalizedRangeTouches(a, b), expected); + assert.equal(generalizedRangeTouches(b, a), expected); } diff --git a/packages/lib-common/src/types/isGeneralizedRangeEqual.test.ts b/packages/lib-common/src/types/isGeneralizedRangeEqual.test.ts index 5a81b533db..de76df64e4 100644 --- a/packages/lib-common/src/types/isGeneralizedRangeEqual.test.ts +++ b/packages/lib-common/src/types/isGeneralizedRangeEqual.test.ts @@ -1,10 +1,10 @@ -import assert from "assert"; +import * as assert from "node:assert/strict"; import { isGeneralizedRangeEqual } from "./GeneralizedRange"; import { Position } from "./Position"; suite("isGeneralizedRangeEqual", () => { test("character", () => { - assert.strictEqual( + assert.equal( isGeneralizedRangeEqual( { type: "character", @@ -19,7 +19,7 @@ suite("isGeneralizedRangeEqual", () => { ), true, ); - assert.strictEqual( + assert.equal( isGeneralizedRangeEqual( { type: "character", @@ -34,7 +34,7 @@ suite("isGeneralizedRangeEqual", () => { ), false, ); - assert.strictEqual( + assert.equal( isGeneralizedRangeEqual( { type: "character", @@ -49,7 +49,7 @@ suite("isGeneralizedRangeEqual", () => { ), false, ); - assert.strictEqual( + assert.equal( isGeneralizedRangeEqual( { type: "character", @@ -67,21 +67,21 @@ suite("isGeneralizedRangeEqual", () => { }); test("line", () => { - assert.strictEqual( + assert.equal( isGeneralizedRangeEqual( { type: "line", start: 0, end: 0 }, { type: "line", start: 0, end: 0 }, ), true, ); - assert.strictEqual( + assert.equal( isGeneralizedRangeEqual( { type: "line", start: 0, end: 0 }, { type: "line", start: 0, end: 1 }, ), false, ); - assert.strictEqual( + assert.equal( isGeneralizedRangeEqual( { type: "line", start: 0, end: 0 }, { type: "line", start: 1, end: 0 }, @@ -91,7 +91,7 @@ suite("isGeneralizedRangeEqual", () => { }); test("mixed", () => { - assert.strictEqual( + assert.equal( isGeneralizedRangeEqual( { type: "character", @@ -102,7 +102,7 @@ suite("isGeneralizedRangeEqual", () => { ), false, ); - assert.strictEqual( + assert.equal( isGeneralizedRangeEqual( { type: "line", start: 0, end: 0 }, { diff --git a/packages/lib-common/src/types/position.test.ts b/packages/lib-common/src/types/position.test.ts index 5757bf0af8..6fabbc72bf 100644 --- a/packages/lib-common/src/types/position.test.ts +++ b/packages/lib-common/src/types/position.test.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { Position } from "./Position"; suite("Position", () => { diff --git a/packages/lib-common/src/types/range.test.ts b/packages/lib-common/src/types/range.test.ts index c499a1c7c9..96b167a884 100644 --- a/packages/lib-common/src/types/range.test.ts +++ b/packages/lib-common/src/types/range.test.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { Position } from "./Position"; import { Range } from "./Range"; import { Selection } from "./Selection"; diff --git a/packages/lib-common/src/types/selection.test.ts b/packages/lib-common/src/types/selection.test.ts index 592ee7475f..02eb406272 100644 --- a/packages/lib-common/src/types/selection.test.ts +++ b/packages/lib-common/src/types/selection.test.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { Position } from "./Position"; import { Selection } from "./Selection"; diff --git a/packages/lib-common/src/util/uniqWithHash.test.ts b/packages/lib-common/src/util/uniqWithHash.test.ts index 797ea38dd8..e0d60e8e97 100644 --- a/packages/lib-common/src/util/uniqWithHash.test.ts +++ b/packages/lib-common/src/util/uniqWithHash.test.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import * as fc from "fast-check"; import { uniqWith } from "lodash-es"; import { uniqWithHash } from "./uniqWithHash"; @@ -52,7 +52,7 @@ suite("uniqWithHash", () => { (a, b) => a === b, hash, ); - assert.deepStrictEqual(actual, expected); + assert.deepEqual(actual, expected); }; testCases.forEach(check); diff --git a/packages/lib-engine/package.json b/packages/lib-engine/package.json index 94200b5d23..864d22f24c 100644 --- a/packages/lib-engine/package.json +++ b/packages/lib-engine/package.json @@ -31,13 +31,11 @@ "zod": "^4.3.6" }, "devDependencies": { - "@types/chai": "^5.2.3", "@types/js-yaml": "^4.0.9", "@types/lodash-es": "^4.17.12", "@types/mocha": "^10.0.10", "@types/moo": "^0.5.10", "@types/nearley": "^2.11.5", - "chai": "^6.2.2", "js-yaml": "^4.1.1", "web-tree-sitter": "^0.26.7" } diff --git a/packages/lib-engine/src/core/UndoStack.test.ts b/packages/lib-engine/src/core/UndoStack.test.ts index c7fa2af603..27f2c6dd26 100644 --- a/packages/lib-engine/src/core/UndoStack.test.ts +++ b/packages/lib-engine/src/core/UndoStack.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import { UndoStack } from "./UndoStack"; suite("UndoStack", () => { @@ -7,12 +7,12 @@ suite("UndoStack", () => { undoStack.push("a"); undoStack.push("b"); undoStack.push("c"); - assert.strictEqual(undoStack.undo(), "b"); - assert.strictEqual(undoStack.undo(), "a"); - assert.strictEqual(undoStack.undo(), undefined); - assert.strictEqual(undoStack.redo(), "b"); - assert.strictEqual(undoStack.redo(), "c"); - assert.strictEqual(undoStack.redo(), undefined); + assert.equal(undoStack.undo(), "b"); + assert.equal(undoStack.undo(), "a"); + assert.equal(undoStack.undo(), undefined); + assert.equal(undoStack.redo(), "b"); + assert.equal(undoStack.redo(), "c"); + assert.equal(undoStack.redo(), undefined); }); test("should clobber stack if push after undo", () => { @@ -20,11 +20,11 @@ suite("UndoStack", () => { undoStack.push("a"); undoStack.push("b"); undoStack.push("c"); - assert.strictEqual(undoStack.undo(), "b"); + assert.equal(undoStack.undo(), "b"); undoStack.push("d"); - assert.strictEqual(undoStack.undo(), "b"); - assert.strictEqual(undoStack.redo(), "d"); - assert.strictEqual(undoStack.redo(), undefined); + assert.equal(undoStack.undo(), "b"); + assert.equal(undoStack.redo(), "d"); + assert.equal(undoStack.redo(), undefined); }); test("should truncate history if max length exceeded", () => { @@ -33,20 +33,20 @@ suite("UndoStack", () => { undoStack.push("b"); undoStack.push("c"); undoStack.push("d"); - assert.strictEqual(undoStack.undo(), "c"); - assert.strictEqual(undoStack.undo(), "b"); - assert.strictEqual(undoStack.undo(), undefined); + assert.equal(undoStack.undo(), "c"); + assert.equal(undoStack.undo(), "b"); + assert.equal(undoStack.undo(), undefined); }); test("should handle empty undo and redo", () => { const undoStack = new UndoStack(3); - assert.strictEqual(undoStack.undo(), undefined); - assert.strictEqual(undoStack.redo(), undefined); + assert.equal(undoStack.undo(), undefined); + assert.equal(undoStack.redo(), undefined); }); test("should handle redo at end of stack", () => { const undoStack = new UndoStack(3); undoStack.push("a"); - assert.strictEqual(undoStack.redo(), undefined); + assert.equal(undoStack.redo(), undefined); }); }); diff --git a/packages/lib-engine/src/core/getPreferredSnippet.test.ts b/packages/lib-engine/src/core/getPreferredSnippet.test.ts index 0bdcaa629f..0418f780c8 100644 --- a/packages/lib-engine/src/core/getPreferredSnippet.test.ts +++ b/packages/lib-engine/src/core/getPreferredSnippet.test.ts @@ -5,7 +5,7 @@ import type { ListInsertSnippetArg, ListWrapWithSnippetArg, } from "@cursorless/lib-common"; -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import { getPreferredSnippet } from "./getPreferredSnippet"; const deprecatedNamed: DeprecatedNamedSnippetArg = { diff --git a/packages/lib-engine/src/customCommandGrammar/grammarAction.test.ts b/packages/lib-engine/src/customCommandGrammar/grammarAction.test.ts index 4ab87830f9..77ebdafce4 100644 --- a/packages/lib-engine/src/customCommandGrammar/grammarAction.test.ts +++ b/packages/lib-engine/src/customCommandGrammar/grammarAction.test.ts @@ -1,5 +1,5 @@ import { type ActionDescriptor } from "@cursorless/lib-common"; -import assert from "assert"; +import * as assert from "node:assert/strict"; import { parseAction } from "./parseCommand"; import type { WithPlaceholders } from "./WithPlaceholders"; @@ -133,7 +133,7 @@ const testCases: TestCase[] = [ suite("custom grammar: actions", () => { testCases.forEach(({ input, expectedOutput }) => { test(input, () => { - assert.deepStrictEqual( + assert.deepEqual( parseAction(input), expectedOutput, JSON.stringify(parseAction(input), null, 4), diff --git a/packages/lib-engine/src/customCommandGrammar/grammarScopeType.test.ts b/packages/lib-engine/src/customCommandGrammar/grammarScopeType.test.ts index 2d39bce833..38b5ee8129 100644 --- a/packages/lib-engine/src/customCommandGrammar/grammarScopeType.test.ts +++ b/packages/lib-engine/src/customCommandGrammar/grammarScopeType.test.ts @@ -1,4 +1,4 @@ -import assert from "assert"; +import * as assert from "node:assert/strict"; import type { ScopeType } from "@cursorless/lib-common"; import { parseScopeType } from "./parseCommand"; @@ -33,7 +33,7 @@ const testCases: TestCase[] = [ suite("custom grammar: scope types", () => { testCases.forEach(({ input, expectedOutput }) => { test(input, () => { - assert.deepStrictEqual(parseScopeType(input), expectedOutput); + assert.deepEqual(parseScopeType(input), expectedOutput); }); }); }); diff --git a/packages/lib-engine/src/customCommandGrammar/lexer.test.ts b/packages/lib-engine/src/customCommandGrammar/lexer.test.ts index f2d5ebdab0..d8cb062d44 100644 --- a/packages/lib-engine/src/customCommandGrammar/lexer.test.ts +++ b/packages/lib-engine/src/customCommandGrammar/lexer.test.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import type { NearleyLexer, NearleyToken } from "./CommandLexer"; import { lexer } from "./lexer"; @@ -88,7 +88,7 @@ const fixtures: Fixture[] = [ suite("custom grammar: lexer", () => { fixtures.forEach(({ input, expectedOutput }) => { test(input, () => { - assert.deepStrictEqual( + assert.deepEqual( Array.from(iterateTokens(lexer, input)).map(({ type, value }) => ({ type, value, diff --git a/packages/lib-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.test.ts b/packages/lib-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.test.ts index 34a96167e4..ef1f858009 100644 --- a/packages/lib-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.test.ts +++ b/packages/lib-engine/src/generateSpokenForm/CustomSpokenFormGeneratorImpl.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import { CustomSpokenFormGeneratorImpl } from "./CustomSpokenFormGeneratorImpl"; import { FakeIDE, LATEST_VERSION, asyncSafety } from "@cursorless/lib-common"; @@ -31,7 +31,7 @@ suite("CustomSpokenFormGeneratorImpl", async function () { await generator.customSpokenFormsInitialized; - assert.deepStrictEqual( + assert.deepEqual( generator.scopeTypeToSpokenForm({ type: "glyph", character: "a", @@ -41,7 +41,7 @@ suite("CustomSpokenFormGeneratorImpl", async function () { spokenForms: ["foo alabaster"], }, ); - assert.deepStrictEqual( + assert.deepEqual( generator.commandToSpokenForm({ version: LATEST_VERSION, action: { diff --git a/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.test.ts b/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.test.ts index 7b656790b6..a27377d4d2 100644 --- a/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.test.ts +++ b/packages/lib-engine/src/generateSpokenForm/generateSpokenForm.test.ts @@ -5,7 +5,7 @@ import { } from "@cursorless/lib-common"; import { getRecordedTestPaths } from "@cursorless/lib-node-common"; import * as yaml from "js-yaml"; -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import { promises as fsp } from "node:fs"; import { SpokenFormGenerator } from "."; import { canonicalizeAndValidateCommand } from "../core/commandVersionUpgrades/canonicalizeAndValidateCommand"; @@ -53,8 +53,8 @@ suite("Generate spoken forms", () => { regex: "foo", }); - assert(spokenForm.type === "success"); - assert.equal(spokenForm.spokenForms, "bar"); + assert.ok(spokenForm.type === "success"); + assert.deepEqual(spokenForm.spokenForms, ["bar"]); }); }); @@ -69,7 +69,7 @@ async function runTest(file: string) { ); if (generatedSpokenForm.type === "success") { - assert(generatedSpokenForm.spokenForms.length === 1); + assert.ok(generatedSpokenForm.spokenForms.length === 1); } if (fixture.marksToCheck != null && generatedSpokenForm.type === "success") { @@ -78,8 +78,8 @@ async function runTest(file: string) { const hatMapSpokenForm = generator.processCommand( getHatMapCommand(fixture.marksToCheck), ); - assert(hatMapSpokenForm.type === "success"); - assert(hatMapSpokenForm.spokenForms.length === 1); + assert.ok(hatMapSpokenForm.type === "success"); + assert.ok(hatMapSpokenForm.spokenForms.length === 1); generatedSpokenForm.spokenForms[0] += " " + hatMapSpokenForm.spokenForms[0]; } diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts b/packages/lib-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts index 5f5f24d152..22f5f0664e 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/checkCaptureStartEnd.test.ts @@ -2,7 +2,7 @@ import type { Messages } from "@cursorless/lib-common"; import { Range } from "@cursorless/lib-common"; import type { QueryCapture } from "./QueryCapture"; import { checkCaptureStartEnd } from "./checkCaptureStartEnd"; -import assert from "assert"; +import * as assert from "node:assert/strict"; interface TestCase { name: string; @@ -201,8 +201,8 @@ suite("checkCaptureStartEnd", () => { })), messages, ); - assert(result === testCase.isValid); - assert.deepStrictEqual(actualErrorIds, testCase.expectedErrorMessageIds); + assert.ok(result === testCase.isValid); + assert.deepEqual(actualErrorIds, testCase.expectedErrorMessageIds); }); } }); diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts b/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts index ed67b10d40..bc783b7fbe 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/parsePredicates.test.ts @@ -1,4 +1,4 @@ -import assert from "assert"; +import * as assert from "node:assert/strict"; import { parsePredicates } from "./parsePredicates"; import type { QueryPredicate } from "web-tree-sitter"; diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts b/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts index 2b4897d9bb..3a6d81ded1 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/rewriteStartOfEndOf.test.ts @@ -1,5 +1,5 @@ import { Range } from "@cursorless/lib-common"; -import assert from "assert"; +import * as assert from "node:assert/strict"; import type { MutableQueryCapture, QueryCapture } from "./QueryCapture"; import { createTestQueryCapture, @@ -60,7 +60,7 @@ suite("rewriteStartOfEndOf", () => { for (const testCase of testCases) { test(testCase.name, () => { const actual = rewriteStartOfEndOf(testCase.captures.map(fillOutCapture)); - assert.deepStrictEqual(actual, testCase.expected.map(fillOutCapture)); + assert.deepEqual(actual, testCase.expected.map(fillOutCapture)); }); } }); diff --git a/packages/lib-engine/src/languages/TreeSitterQuery/validateQueryCaptures.test.ts b/packages/lib-engine/src/languages/TreeSitterQuery/validateQueryCaptures.test.ts index b69626066f..4581e3dddb 100644 --- a/packages/lib-engine/src/languages/TreeSitterQuery/validateQueryCaptures.test.ts +++ b/packages/lib-engine/src/languages/TreeSitterQuery/validateQueryCaptures.test.ts @@ -1,5 +1,5 @@ import { FakeIDE } from "@cursorless/lib-common"; -import assert from "assert"; +import * as assert from "node:assert/strict"; import { validateQueryCaptures } from "./validateQueryCaptures"; const testCases: { name: string; isOk: boolean; content: string }[] = [ diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts index 7b6ffdd4dc..0ac7b664aa 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/BaseScopeHandler.test.ts @@ -7,7 +7,7 @@ import type { ScopeIteratorRequirements, } from "./scopeHandler.types"; import { compareTargetScopes } from "./compareTargetScopes"; -import assert from "assert"; +import * as assert from "node:assert/strict"; class TestScopeHandler extends BaseScopeHandler { public scopeType = undefined; @@ -132,7 +132,7 @@ suite("BaseScopeHandler", () => { getTargets: () => undefined as any, })); - assert.deepStrictEqual( + assert.deepEqual( [...inputScopes] .sort((a, b) => compareTargetScopes(testCase.direction, position, a, b), @@ -163,7 +163,7 @@ suite("BaseScopeHandler", () => { .filter((scope) => scope.shouldYield) .map(({ start, end }) => ({ start, end })); - assert.deepStrictEqual(actualScopes, expectedScopes); + assert.deepEqual(actualScopes, expectedScopes); }); }); }); diff --git a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/util/OneWayNestedRangeFinder.test.ts b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/util/OneWayNestedRangeFinder.test.ts index c2e0df3351..25565f8d48 100644 --- a/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/util/OneWayNestedRangeFinder.test.ts +++ b/packages/lib-engine/src/processTargets/modifiers/scopeHandlers/util/OneWayNestedRangeFinder.test.ts @@ -1,6 +1,6 @@ import { Range } from "@cursorless/lib-common"; import { OneWayNestedRangeFinder } from "./OneWayNestedRangeFinder"; -import assert from "assert"; +import * as assert from "node:assert/strict"; const items = [ { range: new Range(0, 0, 0, 5) }, diff --git a/packages/lib-engine/src/scripts/transformRecordedTests/checkMarks.ts b/packages/lib-engine/src/scripts/transformRecordedTests/checkMarks.ts index 5238aa4f09..5a8285b675 100644 --- a/packages/lib-engine/src/scripts/transformRecordedTests/checkMarks.ts +++ b/packages/lib-engine/src/scripts/transformRecordedTests/checkMarks.ts @@ -1,6 +1,6 @@ import type { TestCaseFixtureLegacy } from "@cursorless/lib-common"; import { FakeIDE } from "@cursorless/lib-common"; -import assert from "assert"; +import * as assert from "node:assert/strict"; import { uniq } from "lodash-es"; import { extractTargetKeys } from "../../testUtil/extractTargetKeys"; import { TokenGraphemeSplitter } from "../../tokenGraphemeSplitter/tokenGraphemeSplitter"; @@ -28,7 +28,7 @@ export function checkMarks(originalFixture: TestCaseFixtureLegacy): undefined { const actualMarks = Object.keys(originalFixture.initialState.marks ?? {}); - assert.deepStrictEqual( + assert.deepEqual( uniq(actualMarks.map(normalizeGraphemes)).sort(), uniq(expectedMarks.map(normalizeGraphemes)).sort(), ); diff --git a/packages/lib-engine/src/scripts/transformRecordedTests/transformFile.ts b/packages/lib-engine/src/scripts/transformRecordedTests/transformFile.ts index 7d3cbbd196..efce2c4709 100644 --- a/packages/lib-engine/src/scripts/transformRecordedTests/transformFile.ts +++ b/packages/lib-engine/src/scripts/transformRecordedTests/transformFile.ts @@ -1,4 +1,4 @@ -import { promises as fsp } from "fs"; +import * as fs from "node:fs/promises"; import * as yaml from "js-yaml"; import type { TestCaseFixture } from "@cursorless/lib-common"; import { serializeTestFixture } from "@cursorless/lib-common"; @@ -8,10 +8,10 @@ export async function transformFile( transformation: FixtureTransformation, file: string, ) { - const buffer = await fsp.readFile(file); + const buffer = await fs.readFile(file); const inputFixture = yaml.load(buffer.toString()) as TestCaseFixture; const outputFixture = transformation(inputFixture); if (outputFixture != null) { - await fsp.writeFile(file, serializeTestFixture(outputFixture)); + await fs.writeFile(file, serializeTestFixture(outputFixture)); } } diff --git a/packages/lib-engine/src/snippets/snippetParser.test.ts b/packages/lib-engine/src/snippets/snippetParser.test.ts index acde22ba7e..0ad3c8422d 100644 --- a/packages/lib-engine/src/snippets/snippetParser.test.ts +++ b/packages/lib-engine/src/snippets/snippetParser.test.ts @@ -2,7 +2,7 @@ * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See https://github.com/microsoft/vscode/blob/6915debdd61d3db26c39e831babf70b573b1baf0/LICENSE.txt for license information. *--------------------------------------------------------------------------------------------*/ -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { SnippetParser } from "./vendor/vscodeSnippet/snippetParser"; suite("SnippetParser", () => { @@ -10,7 +10,7 @@ suite("SnippetParser", () => { function assertTextsnippetString(input: string, expected: string): void { const snippet = new SnippetParser().parse(input); const actual = snippet.toTextmateString(); - assert.strictEqual(actual, expected); + assert.equal(actual, expected); } assertTextsnippetString( diff --git a/packages/lib-engine/src/test/scopes.test.ts b/packages/lib-engine/src/test/scopes.test.ts index a574819c04..3050482a4c 100644 --- a/packages/lib-engine/src/test/scopes.test.ts +++ b/packages/lib-engine/src/test/scopes.test.ts @@ -13,9 +13,9 @@ import { shouldUpdateFixtures, } from "@cursorless/lib-common"; import { getScopeTestPathsRecursively } from "@cursorless/lib-node-common"; -import { assert } from "chai"; import { groupBy, uniq } from "lodash-es"; import { promises as fsp } from "node:fs"; +import * as assert from "node:assert/strict"; import type { TestEnvironment } from "../testUtil/createTestEnvironment"; import { createTestEnvironment } from "../testUtil/createTestEnvironment"; import { @@ -125,8 +125,8 @@ async function runTest( .replaceAll("\r\n", "\n"); const delimiterIndex = fixture.match(/^---$/m)?.index; - assert.isDefined( - delimiterIndex, + assert.ok( + delimiterIndex != null, "Can't find delimiter '---' in scope fixture", ); @@ -150,8 +150,8 @@ async function runTest( }); if (!updateFixture) { - assert.isFalse( - iterationScopes.some((s) => + assert.ok( + !iterationScopes.some((s) => s.ranges.some((r) => !s.domain.contains(r.range)), ), "Iteration range should not contain the domain", @@ -170,14 +170,14 @@ async function runTest( ); if (!updateFixture) { - assert.isFalse( - scopes.some((s) => + assert.ok( + !scopes.some((s) => s.targets.some((t) => !s.domain.contains(t.contentRange)), ), "Content range should not contain the domain", ); - assert.isFalse( - scopes.some((s) => + assert.ok( + !scopes.some((s) => s.targets.some((t) => !s.domain.contains(t.contentRange)), ), "Content range should not contain the removal range", @@ -190,7 +190,7 @@ async function runTest( if (updateFixture) { await fsp.writeFile(file, outputFixture); } else { - assert.isAbove(numScopes, 0, "No scopes found"); + assert.ok(numScopes > 0, "No scopes found"); assert.equal(outputFixture, fixture); } } diff --git a/packages/lib-engine/src/test/sentenceSegmenter.test.ts b/packages/lib-engine/src/test/sentenceSegmenter.test.ts index 586b83d348..e5eefaedab 100644 --- a/packages/lib-engine/src/test/sentenceSegmenter.test.ts +++ b/packages/lib-engine/src/test/sentenceSegmenter.test.ts @@ -1,11 +1,11 @@ -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { SentenceSegmenter } from "../processTargets/modifiers/scopeHandlers/SentenceScopeHandler/SentenceSegmenter"; import { sentenceSegmenterFixture } from "./fixtures/sentenceSegmeter.fixture"; suite("Sentence segmenter", () => { sentenceSegmenterFixture.forEach(({ input, expectedOutput }) => { test(input, () => { - assert.deepStrictEqual( + assert.deepEqual( Array.from(new SentenceSegmenter().segment(input)).map( ({ text }) => text, ), diff --git a/packages/lib-engine/src/test/spokenForms.talon.test.ts b/packages/lib-engine/src/test/spokenForms.talon.test.ts index 16b111b692..68af44ae31 100644 --- a/packages/lib-engine/src/test/spokenForms.talon.test.ts +++ b/packages/lib-engine/src/test/spokenForms.talon.test.ts @@ -5,7 +5,7 @@ import type { } from "@cursorless/lib-common"; import { asyncSafety } from "@cursorless/lib-common"; import { getRecordedTestPaths } from "@cursorless/lib-node-common"; -import assert from "assert"; +import * as assert from "node:assert/strict"; import * as yaml from "js-yaml"; import { promises as fsp } from "node:fs"; import { canonicalizeAndValidateCommand } from "../core/commandVersionUpgrades/canonicalizeAndValidateCommand"; @@ -63,7 +63,7 @@ async function runRecordedFixture(repl: TalonRepl, file: string) { commands.push(getHatMapCommand(fixture.marksToCheck)); } - assert(fixture.command.spokenForm != null); + assert.ok(fixture.command.spokenForm != null); await runTest(repl, fixture.command.spokenForm, commands); } @@ -89,7 +89,7 @@ async function runTest( // If we've already run this test, we don't need to run it again if (alreadyRan[spokenForm] != null) { - assert.deepStrictEqual(alreadyRan[spokenForm], valueForCache); + assert.deepEqual(alreadyRan[spokenForm], valueForCache); return; } @@ -115,7 +115,7 @@ async function runTest( } })(); - assert.deepStrictEqual(commandsActual, commandsExpected); + assert.deepEqual(commandsActual, commandsExpected); } async function setTestMode(repl: TalonRepl, enabled: boolean) { diff --git a/packages/lib-engine/src/test/subtoken.test.ts b/packages/lib-engine/src/test/subtoken.test.ts index c60a19aa78..13f39b9277 100644 --- a/packages/lib-engine/src/test/subtoken.test.ts +++ b/packages/lib-engine/src/test/subtoken.test.ts @@ -1,5 +1,5 @@ import { FakeIDE } from "@cursorless/lib-common"; -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { WordTokenizer } from "../processTargets/modifiers/scopeHandlers/WordScopeHandler/WordTokenizer"; import { subtokenFixture } from "./fixtures/subtoken.fixture"; @@ -8,7 +8,7 @@ suite("subtoken regex matcher", () => { subtokenFixture.forEach(({ input, expectedOutput }) => { test(input, () => { - assert.deepStrictEqual( + assert.deepEqual( new WordTokenizer(ide, "anyLang") .splitIdentifier(input) .map(({ text }) => text), diff --git a/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts b/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts index 88ce925e4a..f308ca5e7c 100644 --- a/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts +++ b/packages/lib-engine/src/tokenGraphemeSplitter/tokenGraphemeSplitter.test.ts @@ -1,6 +1,6 @@ import type { TokenHatSplittingMode } from "@cursorless/lib-common"; import { FakeIDE } from "@cursorless/lib-common"; -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { TokenGraphemeSplitter, UNKNOWN } from "./tokenGraphemeSplitter"; /** @@ -305,7 +305,7 @@ tests.forEach(({ tokenHatSplittingMode, extraTestCases }) => { const actualOutput = new TokenGraphemeSplitter(ide).getTokenGraphemes( input, ); - assert.deepStrictEqual(actualOutput, expectedOutput); + assert.deepEqual(actualOutput, expectedOutput); }); }); }); diff --git a/packages/lib-engine/src/tokenizer/tokenizer.test.ts b/packages/lib-engine/src/tokenizer/tokenizer.test.ts index 54c6914400..50714cdaf9 100644 --- a/packages/lib-engine/src/tokenizer/tokenizer.test.ts +++ b/packages/lib-engine/src/tokenizer/tokenizer.test.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { flatten, range } from "lodash-es"; import { tokenize } from "."; import { FakeIDE } from "@cursorless/lib-common"; @@ -134,7 +134,7 @@ suite("tokenizer", () => { globalTests.forEach(([input, expectedOutput]) => { test(`tokenizer test, input: "${input}"`, () => { const output = tokenize(ide, input, "anyLang", (match) => match[0]); - assert.deepStrictEqual(output, expectedOutput); + assert.deepEqual(output, expectedOutput); }); }); @@ -156,7 +156,7 @@ suite("tokenizer", () => { tests.forEach(([input, expectedOutput]) => { test(`${language} custom tokenizer, input: "${input}"`, () => { const output = tokenize(ide, input, language, (match) => match[0]); - assert.deepStrictEqual(output, expectedOutput); + assert.deepEqual(output, expectedOutput); }); }); }, diff --git a/packages/lib-engine/src/util/allocateHats/maxByFirstDiffering.test.ts b/packages/lib-engine/src/util/allocateHats/maxByFirstDiffering.test.ts index 296b199edd..e9a10acf76 100644 --- a/packages/lib-engine/src/util/allocateHats/maxByFirstDiffering.test.ts +++ b/packages/lib-engine/src/util/allocateHats/maxByFirstDiffering.test.ts @@ -1,4 +1,4 @@ -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { maxByAllowingTies } from "./maxByFirstDiffering"; // known good but slow @@ -34,7 +34,7 @@ suite("maxByFirstDiffering", () => { testCases.forEach((testCase) => { const actual = maxByAllowingTies(testCase, (x) => x); const expected = goldenMaxByAllowingTies(testCase, (x) => x); - assert.deepStrictEqual(actual, expected); + assert.deepEqual(actual, expected); }); }); }); diff --git a/packages/lib-neovim-common/src/ide/neovim/NeovimIDE.ts b/packages/lib-neovim-common/src/ide/neovim/NeovimIDE.ts index b977c8bdfd..84ec004979 100644 --- a/packages/lib-neovim-common/src/ide/neovim/NeovimIDE.ts +++ b/packages/lib-neovim-common/src/ide/neovim/NeovimIDE.ts @@ -21,7 +21,7 @@ import type { import { nodeGetRunMode } from "@cursorless/lib-node-common"; import { pull } from "lodash"; import type { Buffer, NeovimClient, Window } from "neovim"; -import path from "path"; +import * as path from "node:path"; import { v4 as uuid } from "uuid"; import { URI } from "vscode-uri"; import { NeovimCapabilities } from "./NeovimCapabilities"; diff --git a/packages/lib-node-common/package.json b/packages/lib-node-common/package.json index 6895c6a979..e6b3fc9c01 100644 --- a/packages/lib-node-common/package.json +++ b/packages/lib-node-common/package.json @@ -19,10 +19,8 @@ "node-html-parser": "^7.1.0" }, "devDependencies": { - "@types/chai": "^5.2.3", "@types/js-yaml": "^4.0.9", "@types/lodash-es": "^4.17.12", - "chai": "^6.2.2", "js-yaml": "^4.1.1" } } diff --git a/packages/lib-node-common/src/Cheatsheet.ts b/packages/lib-node-common/src/Cheatsheet.ts index 0faacf8653..1ee2ee21ee 100644 --- a/packages/lib-node-common/src/Cheatsheet.ts +++ b/packages/lib-node-common/src/Cheatsheet.ts @@ -4,7 +4,7 @@ import { readFile, writeFile } from "node:fs/promises"; import { produce } from "immer"; import { sortBy } from "lodash-es"; import { parse } from "node-html-parser"; -import * as path from "path"; +import * as path from "node:path"; /** * The argument expected by the cheatsheet command. diff --git a/packages/lib-node-common/src/FileSystemTutorialContentProvider.ts b/packages/lib-node-common/src/FileSystemTutorialContentProvider.ts index e5fd76eac4..6b5f83a376 100644 --- a/packages/lib-node-common/src/FileSystemTutorialContentProvider.ts +++ b/packages/lib-node-common/src/FileSystemTutorialContentProvider.ts @@ -4,7 +4,7 @@ import type { TutorialId, } from "@cursorless/lib-common"; import { readFile, readdir } from "node:fs/promises"; -import path from "path"; +import * as path from "node:path"; import { loadFixture } from "./loadFixture"; export class FileSystemTutorialContentProvider implements TutorialContentProvider { diff --git a/packages/lib-node-common/src/getFixturePaths.ts b/packages/lib-node-common/src/getFixturePaths.ts index 925591d77b..b73d30a350 100644 --- a/packages/lib-node-common/src/getFixturePaths.ts +++ b/packages/lib-node-common/src/getFixturePaths.ts @@ -3,7 +3,7 @@ import type { ScopeSupportFacet, } from "@cursorless/lib-common"; import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; -import * as path from "path"; +import * as path from "node:path"; import { walkFilesSync } from "./walkSync"; export function getFixturesPath() { diff --git a/packages/lib-node-common/src/runRecordedTest.ts b/packages/lib-node-common/src/runRecordedTest.ts index 059135fcfc..cdb10b0b50 100644 --- a/packages/lib-node-common/src/runRecordedTest.ts +++ b/packages/lib-node-common/src/runRecordedTest.ts @@ -25,8 +25,8 @@ import { spyIDERecordedValuesToPlainObject, storedTargetKeys, } from "@cursorless/lib-common"; -import { assert } from "chai"; import { isUndefined } from "lodash-es"; +import * as assert from "node:assert/strict"; import { promises as fsp } from "node:fs"; import { loadFixture } from "./loadFixture"; @@ -40,6 +40,13 @@ function createSelection(selection: SelectionPlainObject): Selection { return new Selection(anchor, active); } +function normalizeRecordedReturnValue(returnValue: unknown) { + // Recorded fixtures store plain serialized data rather than runtime instances. + return returnValue != null && typeof returnValue === "object" + ? JSON.parse(JSON.stringify(returnValue)) + : returnValue; +} + interface RunRecordedTestOpts { /** * The path to the test fixture @@ -175,7 +182,7 @@ export async function runRecordedTest({ await fsp.writeFile(path, serializeTestFixture(outputFixture)); } else if (fixture.thrownError != null) { - assert.strictEqual( + assert.equal( error.name, fixture.thrownError.name, "Unexpected thrown error", @@ -218,29 +225,21 @@ export async function runRecordedTest({ } else { if (fixture.thrownError != null) { throw new Error( - `Expected error ${fixture.thrownError.name} but none was thrown`, + `Expected error ${fixture.thrownError.name}, but none was thrown`, ); } - assert.deepStrictEqual( - resultState, - fixture.finalState, - "Unexpected final state", - ); + assert.deepEqual(resultState, fixture.finalState, "Unexpected final state"); - assert.deepStrictEqual( - returnValue, + assert.deepEqual( + normalizeRecordedReturnValue(returnValue), fixture.returnValue, "Unexpected return value", ); - assert.deepStrictEqual( - fallback, - fixture.fallback, - "Unexpected fallback value", - ); + assert.deepEqual(fallback, fixture.fallback, "Unexpected fallback value"); - assert.deepStrictEqual( + assert.deepEqual( omitByDeep(actualSpyIdeValues, isUndefined), fixture.ide, "Unexpected ide captured values", @@ -259,7 +258,10 @@ function checkMarks( Object.entries(marks).forEach(([key, token]) => { const { hatStyle, character } = splitKey(key); const currentToken = hatTokenMap.getToken(hatStyle, character); - assert(currentToken != null, `Mark "${hatStyle} ${character}" not found`); - assert.deepStrictEqual(rangeToPlainObject(currentToken.range), token); + assert.ok( + currentToken != null, + `Mark "${hatStyle} ${character}" not found`, + ); + assert.deepEqual(rangeToPlainObject(currentToken.range), token); }); } diff --git a/packages/lib-node-common/src/walkAsync.ts b/packages/lib-node-common/src/walkAsync.ts index bd7abff7bf..4333a34060 100644 --- a/packages/lib-node-common/src/walkAsync.ts +++ b/packages/lib-node-common/src/walkAsync.ts @@ -1,5 +1,5 @@ -import * as path from "path"; -import { readdir } from "fs/promises"; +import * as path from "node:path"; +import { readdir } from "node:fs/promises"; import { flatten } from "lodash-es"; /** diff --git a/packages/lib-node-common/src/walkSync.ts b/packages/lib-node-common/src/walkSync.ts index c5058e8869..7ed4e0ab91 100644 --- a/packages/lib-node-common/src/walkSync.ts +++ b/packages/lib-node-common/src/walkSync.ts @@ -1,5 +1,5 @@ -import * as path from "path"; -import { readdirSync } from "fs"; +import * as path from "node:path"; +import { readdirSync } from "node:fs"; /** * Note: Returns full paths diff --git a/packages/lib-sentence-parser/src/test/abbr.test.ts b/packages/lib-sentence-parser/src/test/abbr.test.ts index 0cc33a807a..5d43ee49bd 100644 --- a/packages/lib-sentence-parser/src/test/abbr.test.ts +++ b/packages/lib-sentence-parser/src/test/abbr.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import * as parser from ".."; suite("sentence-parser: Abbreviations in sentences", function () { diff --git a/packages/lib-sentence-parser/src/test/empty.test.ts b/packages/lib-sentence-parser/src/test/empty.test.ts index 8b99ff3bad..f354b9c6f7 100644 --- a/packages/lib-sentence-parser/src/test/empty.test.ts +++ b/packages/lib-sentence-parser/src/test/empty.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import * as parser from ".."; suite("sentence-parser: Empty", function () { diff --git a/packages/lib-sentence-parser/src/test/lists.test.ts b/packages/lib-sentence-parser/src/test/lists.test.ts index ebe679b710..c34871ab48 100644 --- a/packages/lib-sentence-parser/src/test/lists.test.ts +++ b/packages/lib-sentence-parser/src/test/lists.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import * as parser from ".."; suite("sentence-parser: Lists", function () { diff --git a/packages/lib-sentence-parser/src/test/multiple_sentences.test.ts b/packages/lib-sentence-parser/src/test/multiple_sentences.test.ts index 6d5f1a201d..b456ee6616 100644 --- a/packages/lib-sentence-parser/src/test/multiple_sentences.test.ts +++ b/packages/lib-sentence-parser/src/test/multiple_sentences.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import * as parser from ".."; suite("sentence-parser: Multiple sentences", function () { diff --git a/packages/lib-sentence-parser/src/test/newline.test.ts b/packages/lib-sentence-parser/src/test/newline.test.ts index 5458c5b672..ce93e1d620 100644 --- a/packages/lib-sentence-parser/src/test/newline.test.ts +++ b/packages/lib-sentence-parser/src/test/newline.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import * as parser from ".."; suite("sentence-parser: Save newlines", function () { diff --git a/packages/lib-sentence-parser/src/test/preserve_whitespace.test.ts b/packages/lib-sentence-parser/src/test/preserve_whitespace.test.ts index 765ac5c81f..6378836d7c 100644 --- a/packages/lib-sentence-parser/src/test/preserve_whitespace.test.ts +++ b/packages/lib-sentence-parser/src/test/preserve_whitespace.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import * as parser from ".."; const options = { preserveWhitespace: true }; diff --git a/packages/lib-sentence-parser/src/test/single_sentence.test.ts b/packages/lib-sentence-parser/src/test/single_sentence.test.ts index 9fbcfa44c5..f34392064e 100644 --- a/packages/lib-sentence-parser/src/test/single_sentence.test.ts +++ b/packages/lib-sentence-parser/src/test/single_sentence.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import * as parser from ".."; suite("sentence-parser: Single sentences", function () { diff --git a/packages/lib-sentence-parser/src/test/symbols.test.ts b/packages/lib-sentence-parser/src/test/symbols.test.ts index d254d57bf8..8bff864ecc 100644 --- a/packages/lib-sentence-parser/src/test/symbols.test.ts +++ b/packages/lib-sentence-parser/src/test/symbols.test.ts @@ -1,4 +1,4 @@ -import assert from "node:assert"; +import * as assert from "node:assert/strict"; import * as parser from ".."; suite("sentence-parser: Sentences with symbols", function () { diff --git a/packages/test-runner/src/launchNeovimAndRunTests.ts b/packages/test-runner/src/launchNeovimAndRunTests.ts index 5f247a1641..a206ea999a 100644 --- a/packages/test-runner/src/launchNeovimAndRunTests.ts +++ b/packages/test-runner/src/launchNeovimAndRunTests.ts @@ -1,7 +1,7 @@ import { getEnvironmentVariableStrict } from "@cursorless/lib-common"; import { getCursorlessRepoRoot, isWindows } from "@cursorless/lib-node-common"; -import * as cp from "child_process"; -import { copyFile, mkdirSync, readdirSync } from "fs"; +import * as cp from "node:child_process"; +import { copyFile, mkdirSync, readdirSync } from "node:fs"; import process from "node:process"; import { Tail } from "tail"; diff --git a/packages/test-runner/src/scripts/generateTestSubsetFile.ts b/packages/test-runner/src/scripts/generateTestSubsetFile.ts index ebeb2c50a4..5009a887d0 100644 --- a/packages/test-runner/src/scripts/generateTestSubsetFile.ts +++ b/packages/test-runner/src/scripts/generateTestSubsetFile.ts @@ -1,5 +1,5 @@ -import * as child from "child_process"; -import * as fs from "fs"; +import * as child from "node:child_process"; +import * as fs from "node:fs"; import { testSubsetFilePath } from "../testSubset"; const TEMPLATE = `# This file contains the grep strings to pass to Mocha when running a subset of tests. diff --git a/packages/test-vscode-e2e/package.json b/packages/test-vscode-e2e/package.json index 248a42f19c..ab8aefb3e4 100644 --- a/packages/test-vscode-e2e/package.json +++ b/packages/test-vscode-e2e/package.json @@ -17,13 +17,11 @@ "lodash-es": "^4.17.23" }, "devDependencies": { - "@types/chai": "^5.2.3", "@types/lodash-es": "^4.17.12", "@types/mocha": "^10.0.10", "@types/semver": "^7.7.1", "@types/sinon": "^21.0.0", "@types/vscode": "1.98.0", - "chai": "^6.2.2", "semver": "^7.7.4", "sinon": "^21.0.3" } diff --git a/packages/test-vscode-e2e/src/suite/backwardCompatibility.vscode.test.ts b/packages/test-vscode-e2e/src/suite/backwardCompatibility.vscode.test.ts index cf1b38d915..ff93f468d9 100644 --- a/packages/test-vscode-e2e/src/suite/backwardCompatibility.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/backwardCompatibility.vscode.test.ts @@ -3,7 +3,7 @@ import { getCursorlessApi, getReusableEditor, } from "@cursorless/lib-vscode-common"; -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; @@ -31,5 +31,5 @@ async function runTest() { ")", ); - assert.deepStrictEqual(editor.document.getText(), "()"); + assert.equal(editor.document.getText(), "()"); } diff --git a/packages/test-vscode-e2e/src/suite/breakpoints.vscode.test.ts b/packages/test-vscode-e2e/src/suite/breakpoints.vscode.test.ts index 012325f70b..70144eb1de 100644 --- a/packages/test-vscode-e2e/src/suite/breakpoints.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/breakpoints.vscode.test.ts @@ -4,7 +4,7 @@ import { openNewEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; @@ -33,7 +33,7 @@ async function breakpointAdd() { await toggleBreakpoint(); const breakpoints = vscode.debug.breakpoints; - assert.deepStrictEqual(breakpoints.length, 1); + assert.equal(breakpoints.length, 1); assert.ok(breakpoints[0] instanceof vscode.SourceBreakpoint); const breakpoint = breakpoints[0]; assert.ok(breakpoint.location.range.isEqual(new vscode.Range(0, 0, 0, 0))); @@ -46,7 +46,7 @@ async function breakpointTokenAdd() { await toggleTokenBreakpoint(); const breakpoints = vscode.debug.breakpoints; - assert.deepStrictEqual(breakpoints.length, 1); + assert.equal(breakpoints.length, 1); assert.ok(breakpoints[0] instanceof vscode.SourceBreakpoint); const breakpoint = breakpoints[0]; assert.ok(breakpoint.location.range.isEqual(new vscode.Range(0, 2, 0, 7))); @@ -63,11 +63,11 @@ async function breakpointRemove() { ), ]); - assert.deepStrictEqual(vscode.debug.breakpoints.length, 1); + assert.equal(vscode.debug.breakpoints.length, 1); await toggleBreakpoint(); - assert.deepStrictEqual(vscode.debug.breakpoints.length, 0); + assert.equal(vscode.debug.breakpoints.length, 0); } async function breakpointTokenRemove() { @@ -84,12 +84,12 @@ async function breakpointTokenRemove() { ), ]); - assert.deepStrictEqual(vscode.debug.breakpoints.length, 2); + assert.equal(vscode.debug.breakpoints.length, 2); await toggleTokenBreakpoint(); const breakpoints = vscode.debug.breakpoints; - assert.deepStrictEqual(breakpoints.length, 1); + assert.equal(breakpoints.length, 1); assert.ok(breakpoints[0] instanceof vscode.SourceBreakpoint); const breakpoint = breakpoints[0]; assert.ok(breakpoint.location.range.isEqual(new vscode.Range(0, 0, 0, 0))); diff --git a/packages/test-vscode-e2e/src/suite/commandHistory.vscode.test.ts b/packages/test-vscode-e2e/src/suite/commandHistory.vscode.test.ts index 7b8411175c..8ca00ff97c 100644 --- a/packages/test-vscode-e2e/src/suite/commandHistory.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/commandHistory.vscode.test.ts @@ -9,9 +9,9 @@ import { openNewEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import { assert } from "chai"; import { existsSync } from "node:fs"; import { readFile, readdir, rm } from "node:fs/promises"; +import * as assert from "node:assert/strict"; import * as path from "node:path"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; @@ -73,7 +73,7 @@ async function testInactive(tmpdir: string) { await initalizeEditor(); await runCursorlessCommand(takeCommand("e")); - assert.notOk(existsSync(tmpdir)); + assert.ok(!existsSync(tmpdir)); } async function testError(tmpdir: string) { @@ -88,7 +88,7 @@ async function testError(tmpdir: string) { } const content = await getLogEntry(tmpdir); - assert.containsAllKeys(content, ["error"]); + assert.ok("error" in content); delete command.spokenForm; assert.deepEqual(content.command, command); } @@ -96,7 +96,7 @@ async function testError(tmpdir: string) { async function getLogEntry(tmpdir: string) { assert.ok(existsSync(tmpdir)); const paths = await readdir(tmpdir); - assert.lengthOf(paths, 1); + assert.equal(paths.length, 1); assert.ok(/cursorlessCommandHistory_.*\.jsonl/.test(paths[0])); return JSON.parse( diff --git a/packages/test-vscode-e2e/src/suite/containingTokenTwice.vscode.test.ts b/packages/test-vscode-e2e/src/suite/containingTokenTwice.vscode.test.ts index 1a77e820c9..50eadcf8ac 100644 --- a/packages/test-vscode-e2e/src/suite/containingTokenTwice.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/containingTokenTwice.vscode.test.ts @@ -4,7 +4,7 @@ import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import { assert } from "chai"; +import * as assert from "node:assert/strict"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; @@ -40,6 +40,6 @@ async function runTest() { }, }); - assert.isTrue(editor.selection.isEqual(new vscode.Selection(0, 0, 0, 1))); + assert.ok(editor.selection.isEqual(new vscode.Selection(0, 0, 0, 1))); } } diff --git a/packages/test-vscode-e2e/src/suite/crossCellsSetSelection.vscode.test.ts b/packages/test-vscode-e2e/src/suite/crossCellsSetSelection.vscode.test.ts index 775ffcb66a..566c8389ea 100644 --- a/packages/test-vscode-e2e/src/suite/crossCellsSetSelection.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/crossCellsSetSelection.vscode.test.ts @@ -5,7 +5,7 @@ import { openNewNotebookEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import assert from "assert"; +import * as assert from "node:assert/strict"; import { window } from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; @@ -31,7 +31,7 @@ async function runTest() { ); }); - assert(targetHat != null, 'Expected a hat for "world" in the second cell'); + assert.ok(targetHat != null, 'Expected a hat for "world" in the second cell'); const { hatStyle, character } = splitKey(targetHat[0]); await runCursorlessCommand({ @@ -53,5 +53,5 @@ async function runTest() { const editor = window.activeTextEditor; assert.ok(editor != null, "No editor was focused"); - assert.deepStrictEqual(editor.document.getText(editor.selection), "world"); + assert.equal(editor.document.getText(editor.selection), "world"); } diff --git a/packages/test-vscode-e2e/src/suite/editNewCell.vscode.test.ts b/packages/test-vscode-e2e/src/suite/editNewCell.vscode.test.ts index 43ae7834b3..1aad5ffca3 100644 --- a/packages/test-vscode-e2e/src/suite/editNewCell.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/editNewCell.vscode.test.ts @@ -4,7 +4,7 @@ import { openNewNotebookEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { window } from "vscode"; import { endToEndTestSetup, sleepWithBackoff } from "../endToEndTestSetup"; import { getPlainNotebookContents } from "../notebook"; @@ -61,7 +61,7 @@ async function runTest( assert.equal(activeCelIndex, expectedActiveCellIndex); - assert.deepStrictEqual( + assert.deepEqual( getPlainNotebookContents(notebook), expectedNotebookContents, ); diff --git a/packages/test-vscode-e2e/src/suite/explicitMark.vscode.test.ts b/packages/test-vscode-e2e/src/suite/explicitMark.vscode.test.ts index 5298aa3396..151e317421 100644 --- a/packages/test-vscode-e2e/src/suite/explicitMark.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/explicitMark.vscode.test.ts @@ -4,7 +4,7 @@ import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { Selection } from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; diff --git a/packages/test-vscode-e2e/src/suite/fold.vscode.test.ts b/packages/test-vscode-e2e/src/suite/fold.vscode.test.ts index c14a52c639..d5fda199db 100644 --- a/packages/test-vscode-e2e/src/suite/fold.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/fold.vscode.test.ts @@ -3,7 +3,7 @@ import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert"; +import * as assert from "node:assert/strict"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; diff --git a/packages/test-vscode-e2e/src/suite/followLink.vscode.test.ts b/packages/test-vscode-e2e/src/suite/followLink.vscode.test.ts index 76dc9022ed..46a850a561 100644 --- a/packages/test-vscode-e2e/src/suite/followLink.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/followLink.vscode.test.ts @@ -4,7 +4,7 @@ import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; diff --git a/packages/test-vscode-e2e/src/suite/groupByDocument.vscode.test.ts b/packages/test-vscode-e2e/src/suite/groupByDocument.vscode.test.ts index 8c08e3600a..9ce0fa7f59 100644 --- a/packages/test-vscode-e2e/src/suite/groupByDocument.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/groupByDocument.vscode.test.ts @@ -3,7 +3,7 @@ import { getCursorlessApi, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert"; +import * as assert from "node:assert/strict"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; @@ -73,5 +73,5 @@ async function runTest() { }, }); - assert.deepStrictEqual(document.getText(), "world hello"); + assert.equal(document.getText(), "world hello"); } diff --git a/packages/test-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts b/packages/test-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts index 839e42f102..6ed935e692 100644 --- a/packages/test-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/instanceAcrossSplit.vscode.test.ts @@ -10,7 +10,7 @@ import { openNewEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import { Selection } from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; import { setupFake } from "./setupFake"; @@ -158,6 +158,6 @@ async function runTest( }, }); - assert.deepStrictEqual(instanceDocument.getText(), "aaa"); - assert.deepStrictEqual(fromDocument.getText(), expectedContents); + assert.equal(instanceDocument.getText(), "aaa"); + assert.equal(fromDocument.getText(), expectedContents); } diff --git a/packages/test-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts b/packages/test-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts index 01988f7d52..4424a0f1b0 100644 --- a/packages/test-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/keyboard/basic.vscode.test.ts @@ -3,13 +3,13 @@ import { getReusableEditor, openNewEditor, } from "@cursorless/lib-vscode-common"; -import { assert } from "chai"; import * as vscode from "vscode"; import { endToEndTestSetup, sleepWithBackoff } from "../../endToEndTestSetup"; import sinon from "sinon"; import * as path from "node:path"; import { getCursorlessRepoRoot } from "@cursorless/lib-node-common"; import { readFile } from "node:fs/promises"; +import * as assert from "node:assert/strict"; interface TestCase { name: string; @@ -222,7 +222,7 @@ async function basic() { // Select target await typeText("at"); - assert.isTrue(editor.selection.isEqual(new vscode.Selection(0, 0, 0, 17))); + assert.ok(editor.selection.isEqual(new vscode.Selection(0, 0, 0, 17))); // Turn off modal mode and try typing something await vscode.commands.executeCommand("cursorless.keyboard.modal.modeOff"); @@ -244,7 +244,7 @@ async function noAutomaticTokenExpansion() { // "pour" await typeText("ao"); - assert.isTrue(editor.selection.isEqual(new vscode.Selection(1, 0, 1, 0))); + assert.ok(editor.selection.isEqual(new vscode.Selection(1, 0, 1, 0))); } /** @@ -299,11 +299,11 @@ async function enterAndLeaveIsNoOp() { await vscode.commands.executeCommand("cursorless.keyboard.modal.modeOn"); - assert.isTrue(editor.selection.isEqual(originalSelection)); + assert.ok(editor.selection.isEqual(originalSelection)); await vscode.commands.executeCommand("cursorless.keyboard.modal.modeOff"); - assert.isTrue(editor.selection.isEqual(originalSelection)); + assert.ok(editor.selection.isEqual(originalSelection)); } async function typeText(text: string) { diff --git a/packages/test-vscode-e2e/src/suite/performance.vscode.test.ts b/packages/test-vscode-e2e/src/suite/performance.vscode.test.ts index b8f615dbdf..2f8d8a24d7 100644 --- a/packages/test-vscode-e2e/src/suite/performance.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/performance.vscode.test.ts @@ -9,7 +9,7 @@ import { getReusableEditor, runCursorlessAction, } from "@cursorless/lib-vscode-common"; -import assert from "assert"; +import assert from "node:assert/strict"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; import { isCI } from "../isCI"; diff --git a/packages/test-vscode-e2e/src/suite/pourAcrossSplit.vscode.test.ts b/packages/test-vscode-e2e/src/suite/pourAcrossSplit.vscode.test.ts index cf7fada7ea..333c2fd2aa 100644 --- a/packages/test-vscode-e2e/src/suite/pourAcrossSplit.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/pourAcrossSplit.vscode.test.ts @@ -4,7 +4,7 @@ import { openNewEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert"; +import * as assert from "node:assert/strict"; import { endToEndTestSetup } from "../endToEndTestSetup"; suite("Pour across split", async function () { @@ -37,6 +37,6 @@ async function runTest() { }, }); - assert.deepStrictEqual(document1.getText(), "hello world\n"); - assert.deepStrictEqual(document2.getText(), ""); + assert.equal(document1.getText(), "hello world\n"); + assert.equal(document2.getText(), ""); } diff --git a/packages/test-vscode-e2e/src/suite/prePhraseSnapshot.vscode.test.ts b/packages/test-vscode-e2e/src/suite/prePhraseSnapshot.vscode.test.ts index 9f1aeea660..66387b91e6 100644 --- a/packages/test-vscode-e2e/src/suite/prePhraseSnapshot.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/prePhraseSnapshot.vscode.test.ts @@ -9,7 +9,7 @@ import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "assert"; +import * as assert from "node:assert/strict"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; import { mockPrePhraseGetVersion } from "../mockPrePhraseGetVersion"; @@ -106,7 +106,7 @@ async function runTest( }, }); - assert.deepStrictEqual( + assert.deepEqual( editor.selections.map(fromVscodeSelection).map(selectionToPlainObject), expectedSelections.map(fromVscodeSelection).map(selectionToPlainObject), ); diff --git a/packages/test-vscode-e2e/src/suite/revealRange.vscode.test.ts b/packages/test-vscode-e2e/src/suite/revealRange.vscode.test.ts index 61f41fc186..eaeacbbc4b 100644 --- a/packages/test-vscode-e2e/src/suite/revealRange.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/revealRange.vscode.test.ts @@ -3,7 +3,7 @@ import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import assert from "node:assert"; +import assert from "node:assert/strict"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; diff --git a/packages/test-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts b/packages/test-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts index 4aff73cc79..4f8b00ae58 100644 --- a/packages/test-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts +++ b/packages/test-vscode-e2e/src/suite/scopeProvider/assertCalledWithScopeInfo.ts @@ -1,6 +1,6 @@ import { type ScopeType, type ScopeTypeInfo } from "@cursorless/lib-common"; -import { assert } from "chai"; import { isEqual } from "lodash-es"; +import * as assert from "node:assert/strict"; import type { SinonSpy } from "sinon"; import { waitFor } from "../waitFor"; @@ -24,7 +24,7 @@ export async function assertCalledWithScopeInfo( const actualScopeInfo = scopeInfos.find((scopeInfo) => isEqual(scopeInfo.scopeType, expectedScopeInfo.scopeType), ); - assert.isDefined(actualScopeInfo); + assert.ok(actualScopeInfo != null); assert.deepEqual(actualScopeInfo, expectedScopeInfo); } @@ -45,8 +45,9 @@ export async function assertCalledWithoutScopeInfo( ); for (const scopeType of scopeTypes) { - assert.isUndefined( + assert.equal( scopeInfos.find((scopeInfo) => isEqual(scopeInfo.scopeType, scopeType)), + undefined, ); } diff --git a/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts b/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts index 5a0ec8d87d..8a8ecb751c 100644 --- a/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts +++ b/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomRegexScopeInfoTest.ts @@ -1,7 +1,7 @@ import type { ScopeSupportInfo, ScopeType } from "@cursorless/lib-common"; import { ScopeSupport, sleep } from "@cursorless/lib-common"; import { getCursorlessApi, openNewEditor } from "@cursorless/lib-vscode-common"; -import { stat, unlink, writeFile } from "fs/promises"; +import { stat, unlink, writeFile } from "node:fs/promises"; import * as sinon from "sinon"; import { commands } from "vscode"; import { diff --git a/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts b/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts index 58275e59bf..4bb9b5222f 100644 --- a/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts +++ b/packages/test-vscode-e2e/src/suite/scopeProvider/runCustomSpokenFormScopeInfoTest.ts @@ -1,7 +1,7 @@ import type { ScopeTypeInfo } from "@cursorless/lib-common"; import { DOCS_URL, sleep } from "@cursorless/lib-common"; import { getCursorlessApi } from "@cursorless/lib-vscode-common"; -import { stat, unlink, writeFile } from "fs/promises"; +import { stat, unlink, writeFile } from "node:fs/promises"; import * as sinon from "sinon"; import { assertCalledWithScopeInfo } from "./assertCalledWithScopeInfo"; diff --git a/packages/test-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts b/packages/test-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts index ba584724a0..24cecf4cc4 100644 --- a/packages/test-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts +++ b/packages/test-vscode-e2e/src/suite/scopeVisualizer/checkAndResetFakes.ts @@ -1,4 +1,4 @@ -import { assert } from "chai"; +import * as assert from "node:assert/strict"; import type * as sinon from "sinon"; import { createDecorationTypeCallToPlainObject, @@ -8,7 +8,7 @@ import type { Fakes, ExpectedArgs } from "./scopeVisualizerTest.types"; export function checkAndResetFakes(fakes: Fakes, expected: ExpectedArgs) { const actual = getSpyCallsAndResetFakes(fakes); - assert.deepStrictEqual(actual, expected, JSON.stringify(actual)); + assert.deepEqual(actual, expected, JSON.stringify(actual)); } function getSpyCallsAndResetFakes({ diff --git a/packages/test-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts b/packages/test-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts index 718f1a4055..81f3b2e5c0 100644 --- a/packages/test-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/testCaseRecorder.vscode.test.ts @@ -9,9 +9,9 @@ import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import { assert } from "chai"; -import * as crypto from "crypto"; +import * as crypto from "node:crypto"; import { mkdir, readFile, readdir, rm } from "node:fs/promises"; +import * as assert from "node:assert/strict"; import * as os from "node:os"; import * as path from "node:path"; import * as vscode from "vscode"; @@ -153,7 +153,7 @@ async function takeEach() { async function checkRecordedTest(tmpdir: string) { const paths = await readdir(tmpdir); - assert.lengthOf(paths, 1); + assert.equal(paths.length, 1); const actualRecordedTestPath = paths[0]; assert.equal(path.basename(actualRecordedTestPath), "takeEach.yml"); diff --git a/packages/test-vscode-e2e/src/suite/toggleDecorations.vscode.test.ts b/packages/test-vscode-e2e/src/suite/toggleDecorations.vscode.test.ts index c93326e93f..08abbccb41 100644 --- a/packages/test-vscode-e2e/src/suite/toggleDecorations.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/toggleDecorations.vscode.test.ts @@ -2,7 +2,7 @@ import { getCursorlessApi, getReusableEditor, } from "@cursorless/lib-vscode-common"; -import assert from "assert"; +import assert from "node:assert/strict"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; diff --git a/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts b/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts index 9880a68199..0199d32440 100644 --- a/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/tutorial/tutorial.vscode.test.ts @@ -14,8 +14,8 @@ import { type SpyWebViewEvent, } from "@cursorless/lib-vscode-common"; import { isEqual } from "lodash-es"; -import assert from "node:assert"; -import path from "path"; +import assert from "node:assert/strict"; +import path from "node:path"; import sinon from "sinon"; import { commands } from "vscode"; import { endToEndTestSetup } from "../../endToEndTestSetup"; @@ -58,7 +58,7 @@ async function runBasicTutorialTest(spyIde: SpyIDE) { ); const checkStepSetup = async (fixture: TestCaseFixtureLegacy) => { - assert.deepStrictEqual( + assert.deepEqual( await getSnapshotForComparison( fixture.initialState, await hatTokenMap.getReadableMap(false), @@ -171,7 +171,7 @@ async function runBasicTutorialTest(spyIde: SpyIDE) { // Test listing tutorials await commands.executeCommand("cursorless.tutorial.list"); - assert.deepStrictEqual(getTutorialWebviewEventLog().slice(-2), [ + assert.deepEqual(getTutorialWebviewEventLog().slice(-2), [ { type: "messageSent", data: { diff --git a/packages/test-vscode-e2e/src/suite/visible.vscode.test.ts b/packages/test-vscode-e2e/src/suite/visible.vscode.test.ts index 38a0ff752b..a444c4305a 100644 --- a/packages/test-vscode-e2e/src/suite/visible.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/visible.vscode.test.ts @@ -3,7 +3,7 @@ import { getReusableEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert"; +import * as assert from "node:assert/strict"; import * as vscode from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; diff --git a/packages/test-vscode-e2e/src/suite/withinCellSetSelection.vscode.test.ts b/packages/test-vscode-e2e/src/suite/withinCellSetSelection.vscode.test.ts index e9f662c93a..331276e075 100644 --- a/packages/test-vscode-e2e/src/suite/withinCellSetSelection.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/withinCellSetSelection.vscode.test.ts @@ -5,7 +5,7 @@ import { openNewNotebookEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import assert from "assert"; +import * as assert from "node:assert/strict"; import { window } from "vscode"; import { endToEndTestSetup } from "../endToEndTestSetup"; @@ -31,7 +31,10 @@ async function runTest() { ); }); - assert(targetHat != null, 'Expected a default hat for "world" in the cell'); + assert.ok( + targetHat != null, + 'Expected a default hat for "world" in the cell', + ); const { hatStyle, character } = splitKey(targetHat[0]); await runCursorlessCommand({ @@ -54,5 +57,5 @@ async function runTest() { assert.ok(editor != null, "No editor was focused"); - assert.deepStrictEqual(editor.document.getText(editor.selection), "world"); + assert.equal(editor.document.getText(editor.selection), "world"); } diff --git a/packages/test-vscode-e2e/src/suite/wrapWithSnippetAcrossSplit.vscode.test.ts b/packages/test-vscode-e2e/src/suite/wrapWithSnippetAcrossSplit.vscode.test.ts index 7adddf7f40..5114d311ee 100644 --- a/packages/test-vscode-e2e/src/suite/wrapWithSnippetAcrossSplit.vscode.test.ts +++ b/packages/test-vscode-e2e/src/suite/wrapWithSnippetAcrossSplit.vscode.test.ts @@ -4,7 +4,7 @@ import { openNewEditor, runCursorlessCommand, } from "@cursorless/lib-vscode-common"; -import * as assert from "node:assert"; +import * as assert from "node:assert/strict"; import { endToEndTestSetup } from "../endToEndTestSetup"; import { setupFake } from "./setupFake"; @@ -48,9 +48,9 @@ async function runTest() { }, }); - assert.deepStrictEqual( + assert.equal( document1.getText(), "My friend hello likes to eat spaghetti! world", ); - assert.deepStrictEqual(document2.getText(), ""); + assert.equal(document2.getText(), ""); } diff --git a/packages/tool-meta-updater/src/toPosixPath.ts b/packages/tool-meta-updater/src/toPosixPath.ts index 526c3dc3b9..f84128a9bc 100644 --- a/packages/tool-meta-updater/src/toPosixPath.ts +++ b/packages/tool-meta-updater/src/toPosixPath.ts @@ -1,4 +1,4 @@ -import * as path from "path"; +import * as path from "node:path"; export function toPosixPath(p: string) { return p.split(path.sep).join(path.posix.sep); diff --git a/packages/tool-meta-updater/src/updateTSConfig.ts b/packages/tool-meta-updater/src/updateTSConfig.ts index 2fd4c67ebd..2731d6d850 100644 --- a/packages/tool-meta-updater/src/updateTSConfig.ts +++ b/packages/tool-meta-updater/src/updateTSConfig.ts @@ -2,7 +2,7 @@ import { getLockfileImporterId } from "@pnpm/lockfile-file"; import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; import { cloneDeep, isEqual } from "lodash-es"; import normalizePath from "normalize-path"; -import * as path from "path"; +import * as path from "node:path"; import type { TsConfigJson } from "type-fest"; import type { Context } from "./Context"; import { toPosixPath } from "./toPosixPath"; diff --git a/packages/tool-meta-updater/src/updateTSConfigBase.ts b/packages/tool-meta-updater/src/updateTSConfigBase.ts index 8b60948c3c..97c73a12ea 100644 --- a/packages/tool-meta-updater/src/updateTSConfigBase.ts +++ b/packages/tool-meta-updater/src/updateTSConfigBase.ts @@ -1,5 +1,5 @@ import type { FormatPluginFnOptions } from "@pnpm/meta-updater"; -import * as fs from "fs/promises"; +import * as fs from "node:fs/promises"; import type { PackageJson, TsConfigJson } from "type-fest"; import type { Context } from "./Context"; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index a199f38845..ac41ec45c9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -442,9 +442,6 @@ importers: specifier: ^4.3.6 version: 4.3.6 devDependencies: - '@types/chai': - specifier: ^5.2.3 - version: 5.2.3 '@types/js-yaml': specifier: ^4.0.9 version: 4.0.9 @@ -460,9 +457,6 @@ importers: '@types/nearley': specifier: ^2.11.5 version: 2.11.5(patch_hash=72ccc6b9fd704c6d457027e12d6e1d005695ab3508558a08c6aaf73fb608ef69) - chai: - specifier: ^6.2.2 - version: 6.2.2 js-yaml: specifier: ^4.1.1 version: 4.1.1 @@ -521,18 +515,12 @@ importers: specifier: ^7.1.0 version: 7.1.0 devDependencies: - '@types/chai': - specifier: ^5.2.3 - version: 5.2.3 '@types/js-yaml': specifier: ^4.0.9 version: 4.0.9 '@types/lodash-es': specifier: ^4.17.12 version: 4.17.12 - chai: - specifier: ^6.2.2 - version: 6.2.2 js-yaml: specifier: ^4.1.1 version: 4.1.1 @@ -746,9 +734,6 @@ importers: specifier: ^4.17.23 version: 4.17.23 devDependencies: - '@types/chai': - specifier: ^5.2.3 - version: 5.2.3 '@types/lodash-es': specifier: ^4.17.12 version: 4.17.12 @@ -764,9 +749,6 @@ importers: '@types/vscode': specifier: 1.98.0 version: 1.98.0 - chai: - specifier: ^6.2.2 - version: 6.2.2 semver: specifier: ^7.7.4 version: 7.7.4 @@ -4634,9 +4616,6 @@ packages: '@types/bonjour@3.5.13': resolution: {integrity: sha512-z9fJ5Im06zvUL548KvYNecEVlA7cVDkGUi6kZusb04mpyEFKCIZJvloCcmpmLaIahDpOQGHaHmG6imtPMmPXGQ==} - '@types/chai@5.2.3': - resolution: {integrity: sha512-Mw558oeA9fFbv65/y4mHtXDs9bPnFMZAL/jxdPFUpOHHIXX91mcgEHbS5Lahr+pwZFR8A7GQleRWeI6cGFC2UA==} - '@types/connect-history-api-fallback@1.5.4': resolution: {integrity: sha512-n6Cr2xS1h4uAulPRdlw6Jl6s1oG8KrVilPN2yUITEs+K48EzMJJ3W1xy8K5eWuFvjp3R74AOIGSmp2UfBJ8HFw==} @@ -4649,9 +4628,6 @@ packages: '@types/debug@4.1.13': resolution: {integrity: sha512-KSVgmQmzMwPlmtljOomayoR89W4FynCAi3E8PPs7vmDVPe84hT+vGPKkJfThkmXs0x0jAaa9U8uW8bbfyS2fWw==} - '@types/deep-eql@4.0.2': - resolution: {integrity: sha512-c9h9dVVMigMPc4bwTvC5dxqtqJZwQPePsWjPlpSOnojbor6pGqdk541lfA7AqFQr5pB1BRdq0juY9db81BwyFw==} - '@types/eslint-scope@3.7.7': resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} @@ -5224,10 +5200,6 @@ packages: resolution: {integrity: sha512-uLvq6KJu04qoQM6gvBfKFjlh6Gl0vOKQuR5cJMDHQkmwfMOQeN3F3SHCv9SNYSL+CRoHvOGFfllDlVz03GQjvQ==} engines: {node: '>=12.0.0'} - assertion-error@2.0.1: - resolution: {integrity: sha512-Izi8RQcffqCeNVgFigKli1ssklIbpHnCYc6AknXGYoB6grJqyeby7jv12JUQgmTAnIDnbck1uxksT4dzN3PWBA==} - engines: {node: '>=12'} - astral-regex@2.0.0: resolution: {integrity: sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==} engines: {node: '>=8'} @@ -5509,10 +5481,6 @@ packages: peerDependencies: react: '>=17.0.0' - chai@6.2.2: - resolution: {integrity: sha512-NUPRluOfOiTKBKvWPtSD4PhFvWCqOi0BGStNWs57X9js7XGTprSmFoz5F0tWhR4WPjNeR9jXqdC7/UpSJTnlRg==} - engines: {node: '>=18'} - chalk@3.0.0: resolution: {integrity: sha512-4D3B6Wf41KOYRFdszmDqMCGq5VV/uMAB273JILmO+3jAlh8X4qDtdtgCR3fxtbLEMzSx22QdhnDcJvu2u1fVwg==} engines: {node: '>=8'} @@ -15921,11 +15889,6 @@ snapshots: dependencies: '@types/node': 24.12.0 - '@types/chai@5.2.3': - dependencies: - '@types/deep-eql': 4.0.2 - assertion-error: 2.0.1 - '@types/connect-history-api-fallback@1.5.4': dependencies: '@types/express-serve-static-core': 4.19.8 @@ -15943,8 +15906,6 @@ snapshots: dependencies: '@types/ms': 2.1.0 - '@types/deep-eql@4.0.2': {} - '@types/eslint-scope@3.7.7': dependencies: '@types/eslint': 9.6.1 @@ -16529,8 +16490,6 @@ snapshots: pvutils: 1.1.5 tslib: 2.8.1 - assertion-error@2.0.1: {} - astral-regex@2.0.0: {} astring@1.9.0: {} @@ -16895,8 +16854,6 @@ snapshots: dependencies: react: 19.2.4 - chai@6.2.2: {} - chalk@3.0.0: dependencies: ansi-styles: 4.3.0