diff --git a/frontend/obsidian-plugin/jest.config.js b/frontend/obsidian-plugin/jest.config.js index 8c1027ee..d1cbaca2 100644 --- a/frontend/obsidian-plugin/jest.config.js +++ b/frontend/obsidian-plugin/jest.config.js @@ -1,3 +1,3 @@ module.exports = { - preset: "ts-jest/presets/js-with-babel-esm" + preset: "ts-jest" }; diff --git a/frontend/obsidian-plugin/src/obsidian-file-system.ts b/frontend/obsidian-plugin/src/obsidian-file-system.ts index a3951991..1129ac55 100644 --- a/frontend/obsidian-plugin/src/obsidian-file-system.ts +++ b/frontend/obsidian-plugin/src/obsidian-file-system.ts @@ -106,10 +106,9 @@ export class ObsidianFileSystemOperations implements FileSystemOperations { view.editor.setValue(result.text); const selections = []; - const resultCursors = result.cursors ?? []; - for (let i = 0; i < resultCursors.length / 2; i++) { - const from = resultCursors[2 * i]; - const to = resultCursors[2 * i + 1]; + for (let i = 0; i < result.cursors.length / 2; i++) { + const from = result.cursors[2 * i]; + const to = result.cursors[2 * i + 1]; const { line: fromLine, column: fromColumn } = positionToLineAndColumn(result.text, from.position); diff --git a/frontend/sync-client/jest.config.js b/frontend/sync-client/jest.config.js index 8c1027ee..d1cbaca2 100644 --- a/frontend/sync-client/jest.config.js +++ b/frontend/sync-client/jest.config.js @@ -1,3 +1,3 @@ module.exports = { - preset: "ts-jest/presets/js-with-babel-esm" + preset: "ts-jest" }; diff --git a/frontend/sync-client/package.json b/frontend/sync-client/package.json index 82b5dfbe..8128d4de 100644 --- a/frontend/sync-client/package.json +++ b/frontend/sync-client/package.json @@ -10,7 +10,7 @@ "scripts": { "dev": "webpack watch --mode development", "build": "webpack --mode production", - "test": "NODE_OPTIONS=\"$NODE_OPTIONS --experimental-vm-modules\" jest" + "test": "jest" }, "dependencies": { "byte-base64": "^1.1.0", @@ -32,4 +32,4 @@ "webpack-merge": "^6.0.1", "ws": "^8.18.2" } -} +} \ No newline at end of file diff --git a/frontend/sync-client/src/utils/assert-set-contains-exactly.ts b/frontend/sync-client/src/utils/assert-set-contains-exactly.ts index 9682044e..0532a3d3 100644 --- a/frontend/sync-client/src/utils/assert-set-contains-exactly.ts +++ b/frontend/sync-client/src/utils/assert-set-contains-exactly.ts @@ -1,4 +1,4 @@ -import assert from "assert"; +import * as assert from "assert"; export function assertSetContainsExactly(set: Set, ...values: T[]): void { assert( diff --git a/frontend/test-client/jest.config.js b/frontend/test-client/jest.config.js index 8c1027ee..d1cbaca2 100644 --- a/frontend/test-client/jest.config.js +++ b/frontend/test-client/jest.config.js @@ -1,3 +1,3 @@ module.exports = { - preset: "ts-jest/presets/js-with-babel-esm" + preset: "ts-jest" };