Skip to content
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

fix(Sandbox): make sure .stryker-tmp does not appear in the sandbox #716

Merged
merged 1 commit into from
Apr 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/stryker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,12 @@ All `TRAVIS` environment variables are set by Travis for each build. However, yo
#### Files in the sandbox
**Command line:** `[--files|-f] src/**/*.js,a.js,test/**/*.js`
**Config file:** `files: ['src/**/*.js', '!src/**/index.js', 'test/**/*.js']`
**Default value:** result of `git ls-files --others --exclude-standard --cached`
**Default value:** result of `git ls-files --others --exclude-standard --cached --exclude .stryker-tmp`
**Mandatory:** No
**Description:**
With `files` you can choose which files should be included in your test runner sandbox.
This is normally not needed as it defaults to all files not ignored by git.
Try it out yourself with this command: `git ls-files --others --exclude-standard --cached`.
Try it out yourself with this command: `git ls-files --others --exclude-standard --cached --exclude .stryker-tmp`.

If you do need to override `files` (for example: when your project does not live in a git repository),
you can override the files here.
Expand Down
2 changes: 1 addition & 1 deletion packages/stryker/src/input/InputFileResolver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export default class InputFileResolver {
}

private resolveFilesUsingGit(): Promise<string[]> {
return exec('git ls-files --others --exclude-standard --cached', { maxBuffer: 10 * 1000 * 1024 })
return exec('git ls-files --others --exclude-standard --cached --exclude .stryker-tmp', { maxBuffer: 10 * 1000 * 1024 })
.then(([stdout]) => stdout.toString())
.then(output => output.split('\n').map(fileName => fileName.trim()))
.then(fileNames => fileNames.filter(fileName => fileName).map(fileName => path.resolve(fileName)))
Expand Down
2 changes: 1 addition & 1 deletion packages/stryker/test/unit/input/InputFileResolverSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ describe('InputFileResolver', () => {
foo/bar/baz.ts
`)]);
const result = await sut.resolve();
expect(childProcessExecStub).calledWith('git ls-files --others --exclude-standard --cached',
expect(childProcessExecStub).calledWith('git ls-files --others --exclude-standard --cached --exclude .stryker-tmp',
{ maxBuffer: 10 * 1000 * 1024 });
expect(result.files.map(file => file.name)).deep.eq([path.resolve('file1.js'), path.resolve('foo/bar/baz.ts')]);
});
Expand Down