Projectroot in stryker configuration object
See original GitHub issueCurrently we are using process.cwd()
in a lot of plugins to resolve the current working directory in some of our stryker packages. This is undesirable in tests we sometimes want to mock the current working directory to “pretend” we’re somewhere else. The only way to do this at the moment is to mock process.cwd()
which can cause side effects. It would be better to define a projectRoot
or base
property on the Stryker config object that points to the current working directory. This way we can make our own Stryker config with a projectRoot
or base
that points somewhere else without harming process.cwd()
.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Projectroot in stryker configuration object · Issue #650 - GitHub
Currently we are using process.cwd() in a lot of plugins to resolve the current working directory in some of our stryker packages.
Read more >Configuration | Stryker Mutator
You run stryker from the test project directory. On some dotnet core projects stryker can run without specifying any custom configuration.
Read more >stryker-mutator/stryker - Gitter
jest.setup.js') in your stryker.conf.js? The docs say that the config should hold a custom Jest configuration object, and mention the possibility to use ......
Read more >Usage - Infection PHP
Without adding it to the config, Infection will not be able to create Mutations because internally it uses new \ReflectionClass() objects. Running Infection....
Read more >Mutation Testing in JavaScript Using Stryker | Shing's Blog
Create a file called stryker.conf.js in the project's root directory ... Simply add the following code in your package.json configuration:.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
As discussed we won’t do this right now.
OK, the way it should work:
basePath
will always be set by stryker and defaults to.
(current directory).If
basePath
is set in stryker.conf.js: that basePath is used, relative to the stryker.conf.js file. For example:path.resolve(path.dirname('path/to/stryker.conf.js'), options.basePath)
This should also solve #245