diff --git a/scripts/cleanupTest.js b/scripts/cleanupTest.js index b59a34baedf..6d3c5b8e61d 100644 --- a/scripts/cleanupTest.js +++ b/scripts/cleanupTest.js @@ -3,7 +3,7 @@ const rimraf = require('rimraf'); const { join } = require('path'); const collectTestFolders = require('./utils'); -const outputDirectories = ['bin', 'binary', 'dist']; +const outputDirectories = ['bin', 'binary', 'dist', 'test-assets', 'test-plugin', 'test-loader']; function folderStrategy(stats, file) { return stats.isDirectory() && outputDirectories.includes(file); diff --git a/test/init/auto/init-auto.test.js b/test/init/auto/init-auto.test.js index 46ebce44f4c..9656b5d2a90 100644 --- a/test/init/auto/init-auto.test.js +++ b/test/init/auto/init-auto.test.js @@ -14,10 +14,6 @@ describe('init auto flag', () => { fs.mkdirSync(genPath); }); - afterAll(() => { - rimraf.sync(genPath); - }); - it('should prompt with w/o auto flag', () => { const { stdout, stderr } = run(genPath, ['init'], false); expect(stdout).toBeTruthy(); diff --git a/test/init/force/init-force.test.js b/test/init/force/init-force.test.js index 09bd9495e3c..f99c940094e 100644 --- a/test/init/force/init-force.test.js +++ b/test/init/force/init-force.test.js @@ -15,10 +15,6 @@ describe('init force flag', () => { fs.mkdirSync(genPath); }); - afterAll(() => { - rimraf.sync(genPath); - }); - it('should scaffold webpack config', async () => { const { stdout } = await runPromptWithAnswers(genPath, ['init', '--force'], [`N${ENTER}`, ENTER, ENTER, ENTER, ENTER, ENTER]); diff --git a/test/init/generator/init-inquirer.test.js b/test/init/generator/init-inquirer.test.js index 476ca1f15de..de3eed1bc31 100644 --- a/test/init/generator/init-inquirer.test.js +++ b/test/init/generator/init-inquirer.test.js @@ -15,10 +15,6 @@ describe('init', () => { fs.mkdirSync(genPath); }); - afterAll(() => { - rimraf.sync(genPath); - }); - it('should scaffold when given answers', async () => { const { stdout } = await runPromptWithAnswers(genPath, ['init'], [`N${ENTER}`, ENTER, ENTER, ENTER, ENTER, ENTER]); diff --git a/test/init/language/css/init-language-css.test.js b/test/init/language/css/init-language-css.test.js index cd3495a7df6..ab8a1c2356b 100644 --- a/test/init/language/css/init-language-css.test.js +++ b/test/init/language/css/init-language-css.test.js @@ -16,10 +16,6 @@ describe('init with SCSS', () => { fs.mkdirSync(genPath); }); - afterAll(() => { - rimraf.sync(genPath); - }); - it('should use SCSS', async () => { const { stdout } = await runPromptWithAnswers( genPath, diff --git a/test/init/language/js/init-language-js.test.js b/test/init/language/js/init-language-js.test.js index 365641588ec..bbe25ffe275 100644 --- a/test/init/language/js/init-language-js.test.js +++ b/test/init/language/js/init-language-js.test.js @@ -16,10 +16,6 @@ describe('init with Typescript', () => { fs.mkdirSync(genPath); }); - afterAll(() => { - rimraf.sync(genPath); - }); - it('should use typescript', async () => { const { stdout } = await runPromptWithAnswers(genPath, ['init'], [`N${ENTER}`, ENTER, ENTER, `${DOWN}${DOWN}${ENTER}`, ENTER]); diff --git a/test/init/multipleEntries/init-multipleEntries.test.js b/test/init/multipleEntries/init-multipleEntries.test.js index 5bad116370c..0c53dea3259 100644 --- a/test/init/multipleEntries/init-multipleEntries.test.js +++ b/test/init/multipleEntries/init-multipleEntries.test.js @@ -15,10 +15,6 @@ describe('init with multiple entries', () => { fs.mkdirSync(genPath); }); - afterAll(() => { - rimraf.sync(genPath); - }); - it('should scaffold with multiple entries', async () => { const { stdout } = await runPromptWithAnswers( genPath, diff --git a/test/loader/loader.test.js b/test/loader/loader.test.js index c8a24fe2f58..d075c322f58 100644 --- a/test/loader/loader.test.js +++ b/test/loader/loader.test.js @@ -20,10 +20,6 @@ describe('loader command', () => { rimraf.sync(loaderPath); }); - afterAll(() => { - rimraf.sync(loaderPath); - }); - it('Should ask the loader name when invoked', () => { const { stdout, stderr } = run(__dirname, ['loader'], false); expect(stdout).toBeTruthy(); diff --git a/test/migrate/config/migrate-config.test.js b/test/migrate/config/migrate-config.test.js index 615b6dd21ce..6144e3b8c7f 100644 --- a/test/migrate/config/migrate-config.test.js +++ b/test/migrate/config/migrate-config.test.js @@ -19,10 +19,6 @@ describe('migrate command', () => { fs.mkdirSync(outputPath); }); - afterAll(() => { - rimraf.sync(outputPath); - }); - it('should warn if the source config file is not specified', () => { const { stderr } = run(__dirname, ['migrate'], false); expect(stderr).toContain('Please specify a path to your webpack config'); diff --git a/test/plugin/plugin.test.js b/test/plugin/plugin.test.js index b1ac55c9739..86931081d92 100644 --- a/test/plugin/plugin.test.js +++ b/test/plugin/plugin.test.js @@ -16,10 +16,6 @@ describe('plugin command', () => { rimraf.sync(pluginPath); }); - afterAll(() => { - rimraf.sync(pluginPath); - }); - it('Should ask the plugin name when invoked', () => { const { stdout, stderr } = run(__dirname, ['plugin'], false); expect(stdout).toBeTruthy();