stryker-mutator / stryker-jest-runner

A plugin to use the Jest test runner and framework in Stryker, the JavaScript mutation testing framework

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Running without custom Jest configuration isn't possible

mthmulders opened this issue · comments

If you don't have a jest.config.js file, nor a jest key in the package.json, Stryker will fail:

[2018-04-02 20:52:17.345] [INFO] ConfigReader - Using stryker.conf.js in the current working directory.
/Users/maarten/Projects/hyperion-web/node_modules/stryker-jest-runner/src/configLoaders/DefaultJestConfigLoader.js:16
            throw new Error('Could not read Jest configuration, please provide a jest.config.js file or a jest config in your package.json');

As a work-around, create a jest.config.js with just

{
}

I don't think this is a nice approach. Maybe we should just let Stryker could handle this situation?

Nice catch! What kind of behaviour would you expect?

I guess it should default to running with default jest config, no? Maybe logging it as an info message.

@mthmulders do you want the honors of implementing this feature?

I'll give it a shot. I'd say Stryker should just follow the Jest behaviour... We'll see if that yields something Stryker can work with.