codeceptjs 4.0.1-beta.11 → 4.0.1-beta.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/utils/typescript.js +7 -2
- package/package.json +1 -1
package/lib/utils/typescript.js
CHANGED
|
@@ -142,8 +142,13 @@ const __dirname = __dirname_fn(__filename);
|
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
144
|
|
|
145
|
-
//
|
|
146
|
-
|
|
145
|
+
// Check for standard module extensions to determine if we should try adding .ts
|
|
146
|
+
const ext = path.extname(importedPath)
|
|
147
|
+
const standardExtensions = ['.js', '.mjs', '.cjs', '.json', '.node']
|
|
148
|
+
const hasStandardExtension = standardExtensions.includes(ext.toLowerCase())
|
|
149
|
+
|
|
150
|
+
// If it doesn't end with .ts and doesn't have a standard extension, try adding .ts
|
|
151
|
+
if (!importedPath.endsWith('.ts') && !hasStandardExtension) {
|
|
147
152
|
const tsPath = importedPath + '.ts'
|
|
148
153
|
if (fs.existsSync(tsPath)) {
|
|
149
154
|
importedPath = tsPath
|