Closed
Description
What are you trying to achieve?
Use EcmaScript Modules (ESM) imports in test files. Example:
import { something } from '../src/something.js`
Feature( 'Example' );
// ...
What do you get instead?
import { something } from '../src/something.js`
^^^^^^
SyntaxError: Cannot use import statement outside a module
at wrapSafe (internal/modules/cjs/loader.js:979:16)
at Module._compile (internal/modules/cjs/loader.js:1027:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at ${APP}\node_modules\mocha\lib\mocha.js:390:36
at Array.forEach (<anonymous>)
at Mocha.loadFiles (${APP}\node_modules\mocha\lib\mocha.js:387:14)
Cannot use import statement outside a module
Details
- CodeceptJS version: 3.2.2
- NodeJS Version: 1415.1
- Operating System: Windows 10
- Configuration file: Same problem with configurations files created with
npx codeceptjs init
for any UI Helper,
Metadata
Metadata
Assignees
Labels
No labels