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.
@@ -142,8 +142,13 @@ const __dirname = __dirname_fn(__filename);
142
142
  }
143
143
  }
144
144
 
145
- // Try adding .ts extension if file doesn't exist and no extension provided
146
- if (!path.extname(importedPath)) {
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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codeceptjs",
3
- "version": "4.0.1-beta.11",
3
+ "version": "4.0.1-beta.12",
4
4
  "type": "module",
5
5
  "description": "Supercharged End 2 End Testing Framework for NodeJS",
6
6
  "keywords": [