Skip to content

Commit

Permalink
test: do not write file into repo during test run
Browse files Browse the repository at this point in the history
  • Loading branch information
iiroj committed Dec 17, 2019
1 parent d091f71 commit 9913bb2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions test/runAll.unmocked.spec.js
Expand Up @@ -197,12 +197,13 @@ describe('runAll', () => {
await execGit(['add', 'test.js'])

// Run lint-staged with action that does horrible things to the file, causing a merge conflict
const testFile = path.resolve(cwd, 'test.js')
await expect(
gitCommit({
config: {
'*.js': file => {
fs.writeFileSync(file[0], Buffer.from(testJsFileUnfixable, 'binary'))
return `prettier --write ${file[0]}`
'*.js': () => {
fs.writeFileSync(testFile, Buffer.from(testJsFileUnfixable, 'binary'))
return `prettier --write ${testFile}`
}
},
quiet: false,
Expand Down

0 comments on commit 9913bb2

Please sign in to comment.