diff --git a/test/runAll.unmocked.spec.js b/test/runAll.unmocked.spec.js index ef6428d04..52c6f9078 100644 --- a/test/runAll.unmocked.spec.js +++ b/test/runAll.unmocked.spec.js @@ -133,81 +133,6 @@ describe('runAll', () => { expect(await readFile('test.js')).toEqual(testJsFilePretty) }) - it('Should succeed when conflicting tasks sequentially edit a file', async () => { - await appendFile('test.js', testJsFileUgly) - - await fs.mkdir(cwd + '/files') - await appendFile('file.js', testJsFileUgly, cwd + '/files') - - await execGit(['add', 'test.js']) - await execGit(['add', 'files']) - - const success = await gitCommit({ - config: { - 'file.js': ['prettier --write', 'git add'], - 'test.js': files => { - // concurrent: false, means this should still work - fs.removeSync(`${cwd}/files`) - return [`prettier --write ${files.join(' ')}`, `git add ${files.join(' ')}`] - } - }, - concurrent: false - }) - - expect(success).toEqual(true) - }) - - it('Should fail when conflicting tasks concurrently edit a file', async () => { - await appendFile('test.js', testJsFileUgly) - await appendFile('test2.js', testJsFileUgly) - - await fs.mkdir(cwd + '/files') - await appendFile('file.js', testJsFileUgly, cwd + '/files') - - await execGit(['add', 'test.js']) - await execGit(['add', 'test2.js']) - await execGit(['add', 'files']) - - const success = await gitCommit({ - config: { - 'file.js': ['prettier --write', 'git add'], - 'test.js': ['prettier --write', 'git add'], - 'test2.js': files => { - // remove `files` so the 1st command should fail - fs.removeSync(`${cwd}/files`) - return [`prettier --write ${files.join(' ')}`, `git add ${files.join(' ')}`] - } - }, - concurrent: true - }) - - expect(success).toEqual(false) - }) - - it('Should succeed when conflicting tasks concurrently (max concurrency 1) edit a file', async () => { - await appendFile('test.js', testJsFileUgly) - - await fs.mkdir(cwd + '/files') - await appendFile('file.js', testJsFileUgly, cwd + '/files') - - await execGit(['add', 'test.js']) - await execGit(['add', 'files']) - - const success = await gitCommit({ - config: { - 'file.js': ['prettier --write', 'git add'], - 'test2.js': files => { - // concurrency of one should prevent save this operation - fs.removeSync(`${cwd}/files`) - return [`prettier --write ${files.join(' ')}`, `git add ${files.join(' ')}`] - } - }, - concurrent: 1 - }) - - expect(success).toEqual(true) - }) - it('Should commit entire staged file when no errors and linter modifies file', async () => { // Stage multiple ugly files await appendFile('test.js', testJsFileUgly)