You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would love for jest-config to expose a new readRawConfig. It reads the Config.InitialOptions from (jest.config.js, jest.config.ts, jest.config.cjs, package.json, etc) without validating them.
Override some options to plug into globals, coverage, etc.
Runs Jest using runCLI providing the config as JSON.
Since Jest doesn't support a way to do step 1, we are forced to recreate the config loading in our plugin. Since Jest keeps adding configuration file formats, it is quite a lot of work to keep up with this.
import{readRawConfig}from'jest-config';import{runCLI}from'jest';constrawConfig: Config.InitialOptions=awaitreadRawConfig('./jest.config.ts');// override some stuffrawConfig.setupFilesAfterEnv=['./my-stryker-hook-file.js'];awaitrunCLI({config: JSON.stringify(rawConfig)});
Alternatives
I've tried using the currently exported readConfig function, but it fills out the rawOptions with all kinds of normalized options. Of I later pass them to runCLI I get a bunch of warnings:
bunch of warnings
● Validation Warning:
Unknown option "nonFlagArgs" with value [] was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://jestjs.io/docs/configuration
node_modules/jest-validate/build/utils.js:101
● Validation Warning:
Unknown option "testPathPattern" with value "" was found.
This is probably a typing mistake. Fixing it will remove this message.
Configuration Documentation:
https://jestjs.io/docs/configuration
Pitch
Supporting mutation testing is supportive the platform idea.
The text was updated successfully, but these errors were encountered:
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.
🚀 Feature Proposal
I would love for
jest-config
to expose a newreadRawConfig
. It reads theConfig.InitialOptions
from (jest.config.js, jest.config.ts, jest.config.cjs, package.json, etc) without validating them.I'd be happy to implement this in a PR!
Motivation
The StrykerJS jest-runner plugin roughly works as follows:
InitialOptions
from user's jest configrunCLI
providing the config as JSON.Since Jest doesn't support a way to do step 1, we are forced to recreate the config loading in our plugin. Since Jest keeps adding configuration file formats, it is quite a lot of work to keep up with this.
See these issues:
stryker-mutator/stryker-js#3710
stryker-mutator/stryker-js#3480
Example
Alternatives
I've tried using the currently exported
readConfig
function, but it fills out the rawOptions with all kinds of normalized options. Of I later pass them torunCLI
I get a bunch of warnings:bunch of warnings
Pitch
Supporting mutation testing is supportive the platform idea.
The text was updated successfully, but these errors were encountered: