stryker-js: Error when run stryker with MochaTestRunner - ReferenceError: ready is not defined

Summary

Error when trying to running stryker. The test try to execute but failed quickly with the error:

19:46:40 (90212) DEBUG MochaTestRunner Starting Mocha test run
undefined:4
return (ready);
^

ReferenceError: ready is not defined
    at eval (eval at deserialize (/home/jess/Projects/work/undefined/backend/gupy-api-darthvader/node_modules/surrial/src/index.js:17:18), <anonymous>:4:1)
    at Object.deserialize (/home/jess/Projects/work/undefined/backend/gupy-api-darthvader/node_modules/surrial/src/index.js:18:19)
    at ChildProcess.worker.on (/home/jess/Projects/work/undefined/backend/gupy-api-darthvader/node_modules/@stryker-mutator/core/src/child-proxy/ChildProcessProxy.js:123:43)
    at ChildProcess.emit (events.js:182:13)
    at emit (internal/child_process.js:812:12)
    at process._tickCallback (internal/process/next_tick.js:63:19)

Stryker config

module.exports = function(config){
  config.set({
    mutator: 'javascript',
    mutate: ['./components/**/*.test.js'],
    packageManager: 'npm',
    reporters: ['clear-text', 'progress'],
    testRunner: 'mocha',
    testFramework: 'mocha',
    coverageAnalysis: 'off',
    mochaOptions: {
      spec: ['./components/**/*.test.js'],
      opts: './test/mocha.opts',
    },
  });
}

Test runner config

Mocha.opts

--timeout=50000
--reporter=progress
--require ts-node/register
--require ./test/MochaBootstrap.js
--require ./test/mocha.env.js
--exit

Stryker environment

├─┬ @stryker-mutator/core@2.4.0
│ ├─┬ @stryker-mutator/api@2.4.0
│ ├── @stryker-mutator/util@2.4.0
├─┬ @stryker-mutator/javascript-mutator@2.4.0
│ ├── @stryker-mutator/api@2.4.0 deduped
├─┬ @stryker-mutator/mocha-framework@2.4.0
│ └── @stryker-mutator/api@2.4.0 deduped
├─┬ @stryker-mutator/mocha-runner@2.4.0
│ ├── @stryker-mutator/api@2.4.0 deduped
├─┬ @stryker-mutator/typescript@2.4.0
│ ├── @stryker-mutator/api@2.4.0 deduped
│ ├── @stryker-mutator/util@2.4.0 deduped

+-- mocha@6.2.0

Test runner environment

# Test command
"NODE_ENV=${NODE_ENV:=test} mocha 'components/**/*.test.js'"

Mocha.opts


--timeout=50000
--reporter=progress
--require ts-node/register
--require ./test/MochaBootstrap.js
--require ./test/mocha.env.js
--exit

Your Environment

software version(s)
node 10.14.1
npm 6.4.1
Operating System Linux

Add stryker.log

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 16 (8 by maintainers)

Most upvoted comments

@kmdrGroch for now this error is not occur, but I issued this new error:

https://github.com/stryker-mutator/stryker/issues/2185

OK @kmdrGroch I’ll try to reproduce the error on example repository, but it’s difficult to reproduce.

Okay @kmdrGroch . I’ll try this and share the repository as soon as possible.

Reproduction project would increase your chances of others reproducing and possibly fixing your issue.

I would also recommend you consider trying the command test runner. I have had better luck with the command test runner in quite a few cases.