We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1a2c30f commit 7033d93Copy full SHA for 7033d93
1 file changed
lib/utils.js
@@ -40,10 +40,19 @@ export const isAsyncFunction = function (fn) {
40
}
41
42
export const resolveImportModulePath = function (modulePath) {
43
+ // 1. If it's an absolute path, convert to a file:// URL
44
if (path.isAbsolute(modulePath)) {
- return pathToFileURL(modulePath).href
45
+ return pathToFileURL(modulePath).href;
46
- return modulePath
47
+
48
+ // 2. If it's a relative path (starts with ./ or ../), resolve it fully
49
+ if (modulePath.startsWith('./') || modulePath.startsWith('../')) {
50
+ return modulePath
51
+ }
52
53
+ // 3. Otherwise, it's likely a bare NPM module (e.g., 'chai', 'codeceptjs')
54
+ // Let Node.js resolve it natively from node_modules
55
+ return modulePath;
56
57
58
export const fileExists = function (filePath) {
0 commit comments