diff --git a/jest.config.js b/jest.config.js index 0f863cd5..b7197d54 100644 --- a/jest.config.js +++ b/jest.config.js @@ -22,9 +22,7 @@ module.exports = { }, setupFilesAfterEnv: ["./tests/setup/expect.js"], snapshotSerializers: ["jest-serializer-vue"], - testMatch: [ - "**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)", - ], + testMatch: ["**/tests/(unit|e2e)/**/*.spec.(js|jsx|ts|tsx)"], testURL: "http://localhost/", watchPlugins: [ "jest-watch-typeahead/filename", diff --git a/package.json b/package.json index 9ab6938c..841f416e 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "postuninstall": "electron-builder install-app-deps", "test:unit": "vue-cli-service test:unit", "test:unit:cover": "vue-cli-service test:unit --coverage", + "test:e2e": "vue-cli-service test:unit 'tests/e2e'", "prettier:check": "prettier --check '**/*'", "prettier:fix": "prettier --write '**/*'", "purge": "rm -rf node_modules ; rm -rf dist ; rm -rf dist_electron ; rm -rf coverage", diff --git a/tests/e2e/electron.spec.js b/tests/e2e/electron.spec.js index c9980fe7..b48bbbe1 100644 --- a/tests/e2e/electron.spec.js +++ b/tests/e2e/electron.spec.js @@ -1,3 +1,4 @@ +import spectron from "spectron"; import testWithSpectron from "vue-cli-plugin-electron-builder/lib/testWithSpectron"; import chai from "chai"; import chaiAsPromised from "chai-as-promised"; @@ -10,12 +11,7 @@ describe("Application launch", function() { let stopServe; beforeEach(function() { - // TODO: THIS CALL IS BUGGED - // BODY: Calling this function causes it to open as many windows as it can - // BODY: until it times out - // BODY: (pending nklayman/vue-cli-plugin-electron-builder#467) - - return testWithSpectron().then(instance => { + return testWithSpectron(spectron).then(instance => { app = instance.app; stopServe = instance.stopServe; }); @@ -27,6 +23,10 @@ describe("Application launch", function() { afterEach(function() { if (app && app.isRunning()) { + // TODO: This call is also bugged + // BODY: This is pending nklayman/vue-cli-plugin-electron-builder#647. + // BODY: See https://github.com/thislooksfun/earthdawn/issues/154 for more + // BODY: info. return stopServe(); } });