diff --git a/jest.config.js b/jest.config.js index e5421966b..978fd91c5 100644 --- a/jest.config.js +++ b/jest.config.js @@ -2,6 +2,7 @@ /** @type {import('jest').Config} */ const config = { + testTimeout: 30000, prettierPath: require.resolve("prettier-2"), forceExit: true, setupFilesAfterEnv: ["/test/setupTestFramework.js"], diff --git a/test/ChangesAndRemovals.test.js b/test/ChangesAndRemovals.test.js index 11c3761ee..e1baba690 100644 --- a/test/ChangesAndRemovals.test.js +++ b/test/ChangesAndRemovals.test.js @@ -72,8 +72,6 @@ function createFiles() { ); } -jest.setTimeout(30000); - describe("ChangesAndRemovals", () => { beforeEach((done) => { cleanup((err) => { diff --git a/test/Compiler-caching.test.js b/test/Compiler-caching.test.js index 859c3f089..2f3fa7e11 100644 --- a/test/Compiler-caching.test.js +++ b/test/Compiler-caching.test.js @@ -9,8 +9,6 @@ const rimraf = require("rimraf"); let fixtureCount = 0; describe("Compiler (caching)", () => { - jest.setTimeout(15000); - function compile(entry, options, callback) { const webpack = require(".."); diff --git a/test/Compiler-filesystem-caching.test.js b/test/Compiler-filesystem-caching.test.js index 2958d4109..88544c396 100644 --- a/test/Compiler-filesystem-caching.test.js +++ b/test/Compiler-filesystem-caching.test.js @@ -9,8 +9,6 @@ const rimraf = require("rimraf"); let fixtureCount = 0; describe("Compiler (filesystem caching)", () => { - jest.setTimeout(5000); - const tempFixturePath = path.join( __dirname, "fixtures", diff --git a/test/Compiler.test.js b/test/Compiler.test.js index 44b6b23c9..4b7836600 100644 --- a/test/Compiler.test.js +++ b/test/Compiler.test.js @@ -9,7 +9,6 @@ const captureStdio = require("./helpers/captureStdio"); const deprecationTracking = require("./helpers/deprecationTracking"); describe("Compiler", () => { - jest.setTimeout(20000); function compile(entry, options, callback) { const noOutputPath = !options.output || !options.output.path; diff --git a/test/HotModuleReplacementPlugin.test.js b/test/HotModuleReplacementPlugin.test.js index 43f0ccfc1..315c47d1a 100644 --- a/test/HotModuleReplacementPlugin.test.js +++ b/test/HotModuleReplacementPlugin.test.js @@ -6,8 +6,6 @@ const fs = require("graceful-fs"); const webpack = require(".."); describe("HotModuleReplacementPlugin", () => { - jest.setTimeout(20000); - it("should not have circular hashes but equal if unmodified", (done) => { const entryFile = path.join( __dirname, diff --git a/test/MultiCompiler.test.js b/test/MultiCompiler.test.js index 306f3dc61..e5800bcc0 100644 --- a/test/MultiCompiler.test.js +++ b/test/MultiCompiler.test.js @@ -32,8 +32,6 @@ const createMultiCompiler = (options) => { }; describe("MultiCompiler", () => { - jest.setTimeout(20000); - it("should trigger 'run' for each child compiler", (done) => { const compiler = createMultiCompiler(); let called = 0; diff --git a/test/NodeTemplatePlugin.test.js b/test/NodeTemplatePlugin.test.js index bbe758092..d543a9be0 100644 --- a/test/NodeTemplatePlugin.test.js +++ b/test/NodeTemplatePlugin.test.js @@ -6,8 +6,6 @@ const path = require("path"); // cspell:word nodetest describe("NodeTemplatePlugin", () => { - jest.setTimeout(20000); - it("should compile and run a simple module", (done) => { const webpack = require(".."); diff --git a/test/Watch.test.js b/test/Watch.test.js index fb544f89e..42d3eb680 100644 --- a/test/Watch.test.js +++ b/test/Watch.test.js @@ -6,8 +6,6 @@ const path = require("path"); const { Volume, createFsFromVolume } = require("memfs"); const webpack = require(".."); -jest.setTimeout(10000); - describe("Watch", () => { it("should only compile a single time", (done) => { let counterBeforeCompile = 0; diff --git a/test/WatchClose.test.js b/test/WatchClose.test.js index 8ad845f09..703893643 100644 --- a/test/WatchClose.test.js +++ b/test/WatchClose.test.js @@ -5,8 +5,6 @@ require("./helpers/warmup-webpack"); const path = require("path"); describe("WatchClose", () => { - jest.setTimeout(5000); - describe("multiple calls watcher", () => { const fixturePath = path.join(__dirname, "fixtures"); const outputPath = path.join(__dirname, "js/WatchClose"); diff --git a/test/WatchDetection.test.js b/test/WatchDetection.test.js index 6be23adbf..f1d8af21b 100644 --- a/test/WatchDetection.test.js +++ b/test/WatchDetection.test.js @@ -14,8 +14,6 @@ describe("WatchDetection", () => { return; } - jest.setTimeout(20000); - createTestCase(100, true); createTestCase(10, true); createTestCase(600, true); diff --git a/test/WatchSuspend.test.js b/test/WatchSuspend.test.js index f40982e80..3684e8078 100644 --- a/test/WatchSuspend.test.js +++ b/test/WatchSuspend.test.js @@ -13,8 +13,6 @@ describe("WatchSuspend", () => { return; } - jest.setTimeout(5000); - describe("suspend and resume watcher", () => { const fixturePath = path.join( __dirname, diff --git a/test/WatcherEvents.test.js b/test/WatcherEvents.test.js index 059c6f0da..1625d9b45 100644 --- a/test/WatcherEvents.test.js +++ b/test/WatcherEvents.test.js @@ -32,8 +32,6 @@ describe("WatcherEvents", () => { return; } - jest.setTimeout(10000); - it("should emit 'watch-close' when using single-compiler mode and the compiler is not running", (done) => { let called = false;