mocha_factory.js is returning an error
See original GitHub issueWhat are you trying to achieve?
I’m just have tried to run my steps using a “mochawesome” to generate the reports.
What do you get instead?
SyntaxError: Unexpected token )
Provide console output if related. Use
--verbose
mode for more details.
codeceptjs run --steps --reporter mochawesome
E:\Java\SasWebCodecept\node_modules\codeceptjs\lib\mocha_factory.js:41
);
^
SyntaxError: Unexpected token )
at createScript (vm.js:56:10)
at Object.runInThisContext (vm.js:97:10)
at Module._compile (module.js:542:28)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (E:\Java\SasWebCodecept\node_modules\codeceptjs\lib\container.js:4:22)
npm ERR! Windows_NT 10.0.15063
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
npm ERR! node v6.11.2
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE
Provide test source code if related
// paste test
Details
- CodeceptJS version: ^1.0.3
- NodeJS Version: v8.2.1
- Operating System: Windows 10 Professional
- Protractor || WebDriverIO || Nightmare version (if related) : “webdriverio”: “^4.9.11”
- Configuration file:
My solution for this !
Just change the version on package.json unfortunately now I need to use the “codeceptjs”:“1.0.2”
Issue Analytics
- State:
- Created 6 years ago
- Comments:11
Top Results From Across the Web
Mocha TypeError when running test · Issue #2623
What are you trying to achieve? Run test with : npx codeceptjs run search_test.js What do you get instead? Provide console output if...
Read more >errors.js - Documentation
errors.js ... @returns {Error} instance detailing the error condition; */; function createNoFilesMatchPatternError(message, pattern) {; var err = new ...
Read more >mocha/mocha.js - chromium/src/third_party
If there is no 'error' event listener then throw. if (doError) {. er = arguments[1]; ... write decodes the given buffer and returns...
Read more >Mocha error in new codeceptjs 3.0 - General Testing
at C:\Users\jonpye\vsproj\newproj\node_modules\codeceptjs\lib\mochaFactory.js:53:46 at Array.forEach () at Suite.
Read more >Mocha give too long error message when testing node.js
js process with a non-zero exit code. 1) it should return a html page 0 passing (2s) 1 failing 1) Async functions it...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Following fix worked for me. you better try. Open node_modules\codeceptjs-nightmare\node_modules\codeceptjs\lib\mocha_factory.js in text editor. There is an additional comma in line 41. Remove it.
attributes, <-- here
Enjoy.!!!This is issue related to NodeJS version… I resolved mine after updating to latest node (v10.6.0)