Skip to content

Commit

Permalink
fix: use file urls for chokidar import
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Mar 23, 2024
1 parent 9a93273 commit 9531c8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

import fs from 'node:fs';
import sysPath from 'node:path';
import {fileURLToPath} from 'node:url';
import {fileURLToPath, pathToFileURL} from 'node:url';
import {promisify} from 'node:util';
import childProcess from 'node:child_process';
import chai from 'chai';
Expand Down Expand Up @@ -2026,7 +2026,7 @@ const runTests = (baseopts) => {
});
it('should not prevent the process from exiting', async () => {
const scriptFile = getFixturePath('script.js');
const chokidarPath = upath.join(__dirname, 'lib/index.js').replace(/\\/g, '\\\\');
const chokidarPath = pathToFileURL(sysPath.join(__dirname, 'lib/index.js')).replace(/\\/g, '\\\\');
const scriptContent = `
(async () => {
const chokidar = await import("${chokidarPath}");
Expand Down

0 comments on commit 9531c8a

Please sign in to comment.