From 9daeb7b7e82d03886e78f1735222d2146d32bf80 Mon Sep 17 00:00:00 2001 From: blzsaa Date: Mon, 30 May 2022 18:58:13 +0200 Subject: [PATCH] fix: eliminate calling deprecated function in cli-plugin-e2e-cypress and cli-plugin-e2e-nightwatch Due to webpack-dev-server's close() method became deprecated in version v4.0.0, currently vue-cli is using version ^4.7.3, everytime when cli-plugin-e2e-cypress or cli-plugin-e2e-nightwatch ran any tests a deprecation warning appeared. From now on method stop() is called instead of close() as advised by the deprecation warning. close #7157 --- packages/@vue/cli-plugin-e2e-cypress/index.js | 4 ++-- packages/@vue/cli-plugin-e2e-nightwatch/index.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/@vue/cli-plugin-e2e-cypress/index.js b/packages/@vue/cli-plugin-e2e-cypress/index.js index 6b81b68de9..4a21712b5d 100644 --- a/packages/@vue/cli-plugin-e2e-cypress/index.js +++ b/packages/@vue/cli-plugin-e2e-cypress/index.js @@ -36,8 +36,8 @@ module.exports = (api, options) => { resolveModule('cypress/bin/cypress', __dirname) const runner = execa(cypressBinPath, cyArgs, { stdio: 'inherit' }) if (server) { - runner.on('exit', () => server.close()) - runner.on('error', () => server.close()) + runner.on('exit', () => server.stop()) + runner.on('error', () => server.stop()) } if (process.env.VUE_CLI_TEST) { diff --git a/packages/@vue/cli-plugin-e2e-nightwatch/index.js b/packages/@vue/cli-plugin-e2e-nightwatch/index.js index 9175fee366..cfeacda32b 100644 --- a/packages/@vue/cli-plugin-e2e-nightwatch/index.js +++ b/packages/@vue/cli-plugin-e2e-nightwatch/index.js @@ -80,8 +80,8 @@ module.exports = (api, options) => { const nightWatchBinPath = require.resolve('nightwatch/bin/nightwatch') const runner = execa(nightWatchBinPath, rawArgs, { stdio: 'inherit' }) if (server) { - runner.on('exit', () => server.close()) - runner.on('error', () => server.close()) + runner.on('exit', () => server.stop()) + runner.on('error', () => server.stop()) } if (process.env.VUE_CLI_TEST) {