From b5d06acf1035faa3560b5ebbff1569114a516a93 Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Sat, 1 Aug 2020 19:13:20 +0300 Subject: [PATCH 1/2] test: increase timeout --- jest.config.js | 1 + setupTest.js | 3 +++ test/CssMinimizerPlugin.test.js | 2 -- test/cache-option.test.js | 2 -- test/cssMinimizerOptions-option.test.js | 2 -- test/parallel-option.test.js | 2 -- test/sourceMap-option.test.js | 2 -- test/test-option.test.js | 2 -- 8 files changed, 4 insertions(+), 12 deletions(-) create mode 100644 setupTest.js diff --git a/jest.config.js b/jest.config.js index c89d4ff..a31dd68 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,4 +1,5 @@ module.exports = { testEnvironment: 'node', snapshotResolver: './test/helpers/snapshotResolver.js', + setupFilesAfterEnv: ['/setupTest.js'], }; diff --git a/setupTest.js b/setupTest.js new file mode 100644 index 0000000..a7e7888 --- /dev/null +++ b/setupTest.js @@ -0,0 +1,3 @@ + + +jest.setTimeout(120000); diff --git a/test/CssMinimizerPlugin.test.js b/test/CssMinimizerPlugin.test.js index fc81c39..0c662c0 100644 --- a/test/CssMinimizerPlugin.test.js +++ b/test/CssMinimizerPlugin.test.js @@ -18,8 +18,6 @@ import { normalizedSourceMap, } from './helpers'; -jest.setTimeout(30000); - describe('CssMinimizerPlugin', () => { const rawSourceMap = { version: 3, diff --git a/test/cache-option.test.js b/test/cache-option.test.js index b90c630..1a05e45 100644 --- a/test/cache-option.test.js +++ b/test/cache-option.test.js @@ -25,8 +25,6 @@ const otherOtherOtherCacheDir = findCacheDir({ name: 'other-other-other-cache-directory', }); -jest.setTimeout(30000); - if (getCompiler.isWebpack4()) { describe('cache option', () => { let compiler; diff --git a/test/cssMinimizerOptions-option.test.js b/test/cssMinimizerOptions-option.test.js index c2b3cd9..a064c8c 100644 --- a/test/cssMinimizerOptions-option.test.js +++ b/test/cssMinimizerOptions-option.test.js @@ -2,8 +2,6 @@ import CssMinimizerPlugin from '../src/index'; import { getCompiler, compile, readAsset, removeCache } from './helpers'; -jest.setTimeout(30000); - describe('when applied with "minimizerOptions" option', () => { beforeEach(() => Promise.all([removeCache()])); diff --git a/test/parallel-option.test.js b/test/parallel-option.test.js index 47b216b..c9127b6 100644 --- a/test/parallel-option.test.js +++ b/test/parallel-option.test.js @@ -44,8 +44,6 @@ jest.mock('jest-worker', () => { const workerPath = require.resolve('../src/minify'); -jest.setTimeout(30000); - describe('parallel option', () => { let compiler; diff --git a/test/sourceMap-option.test.js b/test/sourceMap-option.test.js index db63a38..fb14405 100644 --- a/test/sourceMap-option.test.js +++ b/test/sourceMap-option.test.js @@ -13,8 +13,6 @@ import { getWarnings, } from './helpers'; -jest.setTimeout(30000); - describe('when applied with "sourceMap" option', () => { const baseConfig = { devtool: 'source-map', diff --git a/test/test-option.test.js b/test/test-option.test.js index bfb56b6..a2d196c 100644 --- a/test/test-option.test.js +++ b/test/test-option.test.js @@ -2,8 +2,6 @@ import CssMinimizerPlugin from '../src/index'; import { getCompiler, compile, readAsset, removeCache } from './helpers'; -jest.setTimeout(30000); - describe('when applied with "test" option', () => { let compiler; From bd121da4e40f6d1ac94fa3a4fad34fd6fc0826eb Mon Sep 17 00:00:00 2001 From: evilebottnawi Date: Sat, 1 Aug 2020 19:18:16 +0300 Subject: [PATCH 2/2] test: increase timeout --- setupTest.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/setupTest.js b/setupTest.js index a7e7888..789c166 100644 --- a/setupTest.js +++ b/setupTest.js @@ -1,3 +1 @@ - - jest.setTimeout(120000);