question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

mocha_factory.js is returning an error

See original GitHub issue

What 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:closed
  • Created 6 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
chathurangamdkcommented, Jan 26, 2018

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.!!!

0reactions
peteroraveccommented, Jul 13, 2018

This is issue related to NodeJS version… I resolved mine after updating to latest node (v10.6.0)

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found