Skip to content

Commit

Permalink
fix: fix load esm config on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hugomrdias committed Apr 28, 2023
1 parent 5265722 commit 527dcda
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import path from 'path'
import sade from 'sade'
import kleur from 'kleur'
import { fileURLToPath } from 'url'
import { fileURLToPath, pathToFileURL } from 'url'
import { lilconfig } from 'lilconfig'
import mergeOptions from 'merge-options'
import { runnerOptions } from './src/utils/index.js'
Expand Down Expand Up @@ -108,8 +108,7 @@ const sade2 = new Proxy(sade('playwright-test [files]', true), {

const loadEsm = async (/** @type {string} */ filepath) => {
/** @type {any} */
const res = await import(filepath)

const res = await import(pathToFileURL(filepath).toString())
if (res.default) {
return res.default
}
Expand Down

0 comments on commit 527dcda

Please sign in to comment.