Skip to content

Commit 1577b8b

Browse files
authored
Merge pull request #547 from Bartel-C8/electronTests
Resolves #534
2 parents f750205 + e6a6860 commit 1577b8b

File tree

3 files changed

+117
-6
lines changed

3 files changed

+117
-6
lines changed

.github/workflows/CI.yml

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -149,14 +149,32 @@ jobs:
149149
if: ${{ !matrix.docker }}
150150
uses: nick-fields/retry@v2
151151
with:
152-
timeout_minutes: 8
152+
timeout_minutes: 5
153153
max_attempts: 1
154154
command: |
155155
pnpm run clean
156156
pnpm run test.skip_gc_tests
157+
continue-on-error: "${{ contains(matrix.os, 'ubuntu') && !matrix.docker }}"
158+
159+
- name: Test Electron (Main)
160+
if: "${{ contains(matrix.os, 'ubuntu') && !matrix.docker }}"
161+
uses: nick-fields/retry@v2
162+
with:
163+
timeout_minutes: 5
164+
max_attempts: 1
165+
command: |
166+
sudo apt-get install xvfb
167+
pnpm install -g electron@latest
168+
pnpm run clean
169+
xvfb-run --auto-servernum pnpm run test.electron.main
170+
# continue-on-error: true
157171

158172
- name: Tests + GC Tests (Release)
159173
if: ${{ !matrix.docker }}
160-
run: |
161-
pnpm run clean
162-
pnpm run test
174+
uses: nick-fields/retry@v2
175+
with:
176+
timeout_minutes: 5
177+
max_attempts: 1
178+
command: |
179+
pnpm run clean
180+
pnpm run test

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
"chai": "^4.3.7",
3838
"deasync": "^0.1.28",
3939
"downlevel-dts": "^0.11.0",
40+
"electron-mocha": "^11.0.2",
4041
"eslint-config-atomic": "^1.18.1",
4142
"eslint-plugin-prettier": "^4.2.1",
4243
"fs-extra": "^10.1.0",
@@ -91,8 +92,10 @@
9192
"build.native.debug": "cross-env CMAKE_BUILD_TYPE=Debug node-gyp configure --debug && cross-env CMAKE_BUILD_TYPE=Debug node-gyp build --debug",
9293
"build": "run-s build.js build.native",
9394
"build.debug": "run-s build.js build.native.debug",
94-
"test": "run-s build && mocha",
95-
"test.skip_gc_tests": "run-s build.debug && cross-env SKIP_GC_TESTS=true mocha",
95+
"test": "run-s build && mocha --exit",
96+
"test.skip_gc_tests": "run-s build.debug && cross-env SKIP_GC_TESTS=true mocha --exit",
97+
"test.electron.main": "run-s build && electron-mocha",
98+
"test.electron.renderer": "run-s build && electron-mocha --renderer",
9699
"lint.clang-format": "clang-format -i -style=file ./src/*.cc ./src/*.h ./src/util/*.h",
97100
"lint-test.eslint": "eslint **/*.{ts,tsx,js,jsx,cjs,mjs,json,yaml} --no-error-on-unmatched-pattern --cache --cache-location ./.cache/eslint/",
98101
"lint.eslint": "pnpm run lint-test.eslint --fix",

pnpm-lock.yaml

Lines changed: 90 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)