@@ -33,13 +33,7 @@ import {
3333 findFreePort ,
3434 resolveNightwatchConfig
3535} from './helpers/utils.js'
36- import {
37- DEFAULTS ,
38- TIMING ,
39- TEST_STATE ,
40- CONFIG_FILENAMES ,
41- PLUGIN_GLOBAL_KEY
42- } from './constants.js'
36+ import { DEFAULTS , TIMING , TEST_STATE , PLUGIN_GLOBAL_KEY } from './constants.js'
4337
4438const log = logger ( '@wdio/nightwatch-devtools' )
4539
@@ -607,20 +601,22 @@ class NightwatchDevToolsPlugin {
607601 path . join ( workspaceRoot , sf , modulePath + '.js' ) ,
608602 path . join ( workspaceRoot , sf , modulePath + '.ts' ) ,
609603 path . join ( workspaceRoot , sf , modulePath + '.cjs' ) ,
610- path . join ( workspaceRoot , sf , modulePath ) ,
604+ path . join ( workspaceRoot , sf , modulePath )
611605 ]
612606 : [ ]
613607 )
614608 const possiblePaths = [
615609 // Highest priority: expand module path via each configured src_folder
616610 ...srcFolderPaths ,
617611 // Fallback: treat module path as relative to cwd (works when src_folders isn't nested)
618- ...( modulePath ? [
619- path . join ( workspaceRoot , modulePath + '.js' ) ,
620- path . join ( workspaceRoot , modulePath + '.ts' ) ,
621- path . join ( workspaceRoot , modulePath + '.cjs' ) ,
622- path . join ( workspaceRoot , modulePath ) ,
623- ] : [ ] ) ,
612+ ...( modulePath
613+ ? [
614+ path . join ( workspaceRoot , modulePath + '.js' ) ,
615+ path . join ( workspaceRoot , modulePath + '.ts' ) ,
616+ path . join ( workspaceRoot , modulePath + '.cjs' ) ,
617+ path . join ( workspaceRoot , modulePath )
618+ ]
619+ : [ ] ) ,
624620 path . join ( workspaceRoot , 'example/tests' , testFile + '.js' ) ,
625621 path . join ( workspaceRoot , 'example/tests' , testFile ) ,
626622 path . join ( workspaceRoot , 'tests' , testFile + '.js' ) ,
0 commit comments