Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'editors/code/tests/unit/index.ts')
| -rw-r--r-- | editors/code/tests/unit/index.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/editors/code/tests/unit/index.ts b/editors/code/tests/unit/index.ts index 8ad46546ab..bf74060c73 100644 --- a/editors/code/tests/unit/index.ts +++ b/editors/code/tests/unit/index.ts @@ -1,6 +1,7 @@ import * as assert from "node:assert/strict"; import { readdir } from "fs/promises"; import * as path from "path"; +import { pathToFileURL } from "url"; class Test { readonly name: string; @@ -67,7 +68,7 @@ export async function run(): Promise<void> { ); for (const testFile of testFiles) { try { - const testModule = require(path.resolve(__dirname, testFile)); + const testModule = await import(pathToFileURL(path.resolve(__dirname, testFile)).href); await testModule.getTests(context); } catch (e) { error(`${e}`); |