-
Notifications
You must be signed in to change notification settings - Fork 251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add an option to include additional files #2739
Comments
Would you be helped by a custom |
@nicojs Yes, I think it would be a good option! |
I want to add this (breaking) change to Stryker v5 |
(I mean #1593) |
@EmmanuelRoux I've opened #2848, please take a look. I think that should solve your issue. I didn't want to go as far as to allow |
Add the ability to specify `ignorePatterns` in your Stryker configuration. This replaces `files` option which is now deprecated. By specifying `ignorePatterns` you choose which files should not be copied to the Sandbox directory (inside the `.stryker-tmp` directory). This effectively excludes them from being used during mutation testing. For example: ```json { "ignorePatterns": ["dist"] } ``` This will discover all files in your current working directory, _except_ for files matching the `"dist"` pattern. Stryker uses [.gitignore](https://git-scm.com/docs/gitignore) rules to resolve these patterns. Stryker always adds `['.git', 'node_modules', '/reports', 'stryker.log', '.stryker-tmp']` when resolving these patterns. If you really want them in your sandbox, you can un-ignore them using a `!` prefix in your pattern, for example: ```json { "ignorePatterns": ["!node_modules"] } ``` The `ignorePatterns` is now also the default way files are discovered. Previously, Stryker used `git ls-files --others --exclude-standard --cached --exclude .stryker-tmp` to discover files by default. This had some limitations: * ❌ It only worked inside a git repository and you had to have `git` installed. If not, you got an error and had to use `files` * ❌ If a `.gitignore`'d file is needed to run your tests, you needed to fall back on `files`. Specifying `files` is now deprecated, but still works for the time being. Stryker will rewrite your file patterns internally to ignore patterns. Closes #1593 Closes #2739 BREAKING CHANGE: Stryker will no longer use a git command to determine which files belong to your project. Instead, it will rely on sane defaults. You can change this behavior by defining [`ignorePatterns`](https://stryker-mutator.io/docs/stryker-js/configuration/#ignorepatterns-string). BREAKING CHANGE: The `files` configuration option is deprecated and will be removed in a future release. Please use [`ignorePatterns`](https://stryker-mutator.io/docs/stryker-js/configuration/#ignorepatterns-string) instead. This: ```json { "files": ["foo.js"] } ``` Is equivalent to: ```json { "ignorePatterns": ["**", "!foo.js"] } ```
Closed with #2848 |
@nicojs Thank you very much for this update, I’ll check that in a few weeks ! |
Is your feature request related to a problem? Please describe.
Related to: #2736
When some files ignores by git are needed to run Stryker, there are currently two workarounds:
inPlace
option to avoid using the sandboxfiles
option to list all files that should be copied to sandboxDescribe the solution you'd like
Another nice option would be to have an option similar to
files
but allowing to specify only additional files.The text was updated successfully, but these errors were encountered: