Skip to content

Commit e70dc79

Browse files
committed
test: run examples as part of the tests
1 parent 82a3760 commit e70dc79

File tree

4 files changed

+152
-6
lines changed

4 files changed

+152
-6
lines changed

.github/workflows/CI.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ jobs:
212212
max_attempts: 3
213213
shell: bash
214214
command: |
215-
pnpm run test.unit || (rm -rf ./tmp && mkdir -p ./tmp && exit 1)
215+
pnpm run test || (rm -rf ./tmp && mkdir -p ./tmp && exit 1)
216216
rm -rf ./tmp && mkdir -p ./tmp
217217
218218
- name: Test Electron Windows/MacOS

examples/package.json

+5-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@
55
"zeromq": "file:.."
66
},
77
"devDependencies": {
8-
"ts-node": ">= 0"
8+
"cross-env": "^7.0.3",
9+
"npm-run-all2": "^7.0.2",
10+
"ts-node": "10.9.2"
911
},
1012
"scripts": {
1113
"build": "cd .. && pnpm build && cd ./examples && pnpm install",
@@ -15,6 +17,7 @@
1517
"pub-sub": "ts-node ./pub-sub/index.ts",
1618
"push-pull": "ts-node ./push-pull/index.ts",
1719
"req-rep": "ts-node ./req-rep/index.ts",
18-
"v5-compat": "node ./v5-compat/index.js"
20+
"v5-compat": "node ./v5-compat/index.js",
21+
"test": "cross-env CI=true run-s majordomo queue threaded-worker pub-sub push-pull req-rep"
1922
}
2023
}

examples/pnpm-lock.yaml

+143-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -109,11 +109,12 @@
109109
"build.native.debug": "cross-env npm_config_zmq_enable_sanitizer_undefined=true cmake-ts dev-os-only",
110110
"build": "run-p build.js build.native",
111111
"build.debug": "run-s build.js build.native.debug",
112-
"test": "run-s test.unit",
113-
"test.debug": "run-s test.unit.debug",
112+
"test": "run-s test.unit test.examples",
113+
"test.debug": "run-s test.unit.debug test.examples",
114114
"test.unit": "run-s clean.temp build && cross-env INCLUDE_COMPAT_TESTS=true mocha ./test/unit/*-test.ts ./test/unit/compat/*-test.ts",
115115
"test.unit.debug": "run-s clean.temp build.debug && cross-env INCLUDE_COMPAT_TESTS=true mocha ./test/unit/*-test.ts ./test/unit/compat/*-test.ts",
116116
"test.unit.nogc": "run-s clean.temp build && cross-env SKIP_GC_TESTS=true mocha",
117+
"test.examples": "cd examples && pnpm install && pnpm run test",
117118
"test.electron.main": "run-s clean.temp build && cross-env INCLUDE_COMPAT_TESTS=true SKIP_GC_TESTS=true electron-mocha ./test/unit/*-test.ts ./test/unit/compat/*-test.ts",
118119
"test.electron.renderer": "run-s build && cross-env INCLUDE_COMPAT_TESTS=true SKIP_GC_TESTS=true electron-mocha --renderer ./test/unit/*-test.ts ./test/unit/compat/*-test.ts",
119120
"test.smoke": "bash ./script/smoke-test.bash",

0 commit comments

Comments
 (0)