question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Projectroot in stryker configuration object

See original GitHub issue

Currently 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:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
simondelcommented, Feb 11, 2019

As discussed we won’t do this right now.

1reaction
nicojscommented, Apr 20, 2018

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found