1

I'm new to Stryker and am experiencing an issue when using it in my application. I have the following package.json:

"scripts": {
    "test-stryker": "mocha -r ./tests/setup-mocha.js tests/myFile.test.js",
  }

And my stryker.config.js is:

module.exports = function(config) {
  config.set({
    mutator: "javascript",
    packageManager: "npm",
    reporters: ["clear-text", "progress"],
    testRunner: "command",
    commandRunner: {
        command: "npm run test-stryker"
    },
    transpilers: [],
    mutate: ["schemas/mySchema.js"]
  });
};

./tests/setup-mocha.js file is required for initializing some variables before starting the app and it works perfectly when doing npm run test-stryker But when I want to execute stryker run, that ./tests/setup-mocha.js is never executed.

Any ideas on how to run required scripts before running Stryker?

Thank you in advance!

Saro
  • 810
  • 2
  • 12
  • 22
  • Hi, I think we have a similar setup except that I have it in typescript. You can check it out [here](https://github.com/scaljeri/angular-xxl) maybe it will help – Jeanluca Scaljeri Oct 02 '19 at 06:46

0 Answers0