Skip to content

Commit 5e95d45

Browse files
committed
Updated tests
1 parent e9f612f commit 5e95d45

1 file changed

Lines changed: 5 additions & 9 deletions

File tree

mcp/tools.js

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* This module contains all tool logic but no JSON-RPC / stdio server code.
44
*/
55

6-
import { fileURLToPath } from 'url';
6+
import { fileURLToPath, pathToFileURL } from 'url';
77
import {
88
dirname, resolve, join, extname,
99
} from 'path';
@@ -12,18 +12,14 @@ import fs from 'node:fs';
1212
const __filename = fileURLToPath(import.meta.url);
1313
const __dirname = dirname(__filename);
1414

15-
const scribePath = resolve(__dirname, '..', 'scribe.js');
16-
const scribeModule = await import(scribePath);
15+
const scribeModule = await import(pathToFileURL(resolve(__dirname, '..', 'scribe.js')).href);
1716
const scribe = scribeModule.default;
1817

19-
const writeTextModule = await import(resolve(__dirname, '..', 'js', 'export', 'writeText.js'));
20-
const { writeText } = writeTextModule;
18+
const { writeText } = await import(pathToFileURL(resolve(__dirname, '..', 'js', 'export', 'writeText.js')).href);
2119

22-
const reflowParsModule = await import(resolve(__dirname, '..', 'js', 'utils', 'reflowPars.js'));
23-
const { assignParagraphs } = reflowParsModule;
20+
const { assignParagraphs } = await import(pathToFileURL(resolve(__dirname, '..', 'js', 'utils', 'reflowPars.js')).href);
2421

25-
const dataContainerModule = await import(resolve(__dirname, '..', 'js', 'containers', 'dataContainer.js'));
26-
const { pageMetricsAll } = dataContainerModule;
22+
const { pageMetricsAll } = await import(pathToFileURL(resolve(__dirname, '..', 'js', 'containers', 'dataContainer.js')).href);
2723

2824
const SUPPORTED_EXTENSIONS = ['.pdf', '.png', '.jpg', '.jpeg', '.gif', '.webp', '.bmp', '.tiff', '.tif'];
2925
const DATA_EXTENSIONS = ['.scribe.json', '.json', '.json.gz', '.hocr', '.xml', '.stext', '.txt', '.docx'];

0 commit comments

Comments
 (0)