Skip to content
This repository was archived by the owner on May 31, 2021. It is now read-only.

Commit 3aa093f

Browse files
committed
test(e2e): marginal work on e2e tests
Since nklayman/vue-cli-plugin-electron-builder#467 was fixed `testWithSpectron()` works again, but now `stopServe()` is broken.
1 parent 2318520 commit 3aa093f

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

jest.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ module.exports = {
2222
},
2323
setupFilesAfterEnv: ["./tests/setup/expect.js"],
2424
snapshotSerializers: ["jest-serializer-vue"],
25-
testMatch: [
26-
"**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)",
27-
],
25+
testMatch: ["**/tests/(unit|e2e)/**/*.spec.(js|jsx|ts|tsx)"],
2826
testURL: "http://localhost/",
2927
watchPlugins: [
3028
"jest-watch-typeahead/filename",

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"postuninstall": "electron-builder install-app-deps",
1919
"test:unit": "vue-cli-service test:unit",
2020
"test:unit:cover": "vue-cli-service test:unit --coverage",
21+
"test:e2e": "vue-cli-service test:unit 'tests/e2e'",
2122
"prettier:check": "prettier --check '**/*'",
2223
"prettier:fix": "prettier --write '**/*'",
2324
"purge": "rm -rf node_modules ; rm -rf dist ; rm -rf dist_electron ; rm -rf coverage",

tests/e2e/electron.spec.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import spectron from "spectron";
12
import testWithSpectron from "vue-cli-plugin-electron-builder/lib/testWithSpectron";
23
import chai from "chai";
34
import chaiAsPromised from "chai-as-promised";
@@ -10,12 +11,7 @@ describe("Application launch", function() {
1011
let stopServe;
1112

1213
beforeEach(function() {
13-
// TODO: THIS CALL IS BUGGED
14-
// BODY: Calling this function causes it to open as many windows as it can
15-
// BODY: until it times out
16-
// BODY: (pending nklayman/vue-cli-plugin-electron-builder#467)
17-
18-
return testWithSpectron().then(instance => {
14+
return testWithSpectron(spectron).then(instance => {
1915
app = instance.app;
2016
stopServe = instance.stopServe;
2117
});
@@ -27,6 +23,10 @@ describe("Application launch", function() {
2723

2824
afterEach(function() {
2925
if (app && app.isRunning()) {
26+
// TODO: This call is also bugged
27+
// BODY: This is pending nklayman/vue-cli-plugin-electron-builder#647.
28+
// BODY: See https://github.com/thislooksfun/earthdawn/issues/154 for more
29+
// BODY: info.
3030
return stopServe();
3131
}
3232
});

0 commit comments

Comments
 (0)