From 713b73a4e2384cbbca195f431d8924d1f83807c5 Mon Sep 17 00:00:00 2001 From: Nitin Kumar Date: Mon, 26 Apr 2021 08:10:47 +0530 Subject: [PATCH] chore: don't print webpack version for each test --- jest.config.js | 1 + scripts/globalSetup.js | 4 ++++ test/helpers/snapshotResolver.js | 3 --- 3 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 scripts/globalSetup.js diff --git a/jest.config.js b/jest.config.js index b6f7c3cf0..9dd5fb46f 100644 --- a/jest.config.js +++ b/jest.config.js @@ -5,5 +5,6 @@ module.exports = { moduleFileExtensions: ['js', 'json'], testMatch: ['**/test/**/*.test.js'], setupFilesAfterEnv: ['/setupTest.js'], + globalSetup: '/scripts/globalSetup.js', snapshotResolver: './test/helpers/snapshotResolver.js', }; diff --git a/scripts/globalSetup.js b/scripts/globalSetup.js new file mode 100644 index 000000000..92d141134 --- /dev/null +++ b/scripts/globalSetup.js @@ -0,0 +1,4 @@ +const { version } = require('webpack'); + +module.exports = () => + console.log(`\n Running tests for webpack @${version} \n`); diff --git a/test/helpers/snapshotResolver.js b/test/helpers/snapshotResolver.js index 742ee5b60..c5800fccc 100644 --- a/test/helpers/snapshotResolver.js +++ b/test/helpers/snapshotResolver.js @@ -6,9 +6,6 @@ const webpack = require('webpack'); const [webpackVersion] = webpack.version; const snapshotExtension = `.snap.webpack${webpackVersion}`; -// eslint-disable-next-line no-console -console.log('Current webpack version:', webpackVersion); - module.exports = { resolveSnapshotPath: (testPath) => path.join(