diff --git a/generator/templates/tests-mocha/tests/unit/electron.spec.js b/generator/templates/tests-mocha/tests/unit/electron.spec.js
index <HASH>..<HASH> 100644
--- a/generator/templates/tests-mocha/tests/unit/electron.spec.js
+++ b/generator/templates/tests-mocha/tests/unit/electron.spec.js
@@ -1,4 +1,5 @@
-import spectron from 'spectron'
+// eslint-disable-next-line no-undef
+const spectron = __non_webpack_require__('spectron')
 import testWithSpectron from 'vue-cli-plugin-electron-builder/lib/testWithSpectron'
 import chai from 'chai'
 import chaiAsPromised from 'chai-as-promised'
fix(generator/mocha): non webpack require spectron