Skip to content

Commit

Permalink
test: run examples as part of the tests
Browse files Browse the repository at this point in the history
  • Loading branch information
aminya committed Jan 6, 2025
1 parent 7b553eb commit 586fe8d
Show file tree
Hide file tree
Showing 4 changed files with 152 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ jobs:
max_attempts: 3
shell: bash
command: |
pnpm run test.unit || (rm -rf ./tmp && mkdir -p ./tmp && exit 1)
pnpm run test || (rm -rf ./tmp && mkdir -p ./tmp && exit 1)
rm -rf ./tmp && mkdir -p ./tmp
- name: Test Electron Windows/MacOS
Expand Down
7 changes: 5 additions & 2 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"zeromq": "file:.."
},
"devDependencies": {
"ts-node": ">= 0"
"cross-env": "^7.0.3",
"npm-run-all2": "^7.0.2",
"ts-node": "10.9.2"
},
"scripts": {
"build": "cd .. && pnpm build && cd ./examples && pnpm install",
Expand All @@ -15,6 +17,7 @@
"pub-sub": "ts-node ./pub-sub/index.ts",
"push-pull": "ts-node ./push-pull/index.ts",
"req-rep": "ts-node ./req-rep/index.ts",
"v5-compat": "node ./v5-compat/index.js"
"v5-compat": "node ./v5-compat/index.js",
"test": "cross-env CI=true run-s majordomo queue threaded-worker pub-sub push-pull req-rep"
}
}
144 changes: 143 additions & 1 deletion examples/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,12 @@
"build.native.debug": "cross-env npm_config_zmq_enable_sanitizer_undefined=true cmake-ts dev-os-only",
"build": "run-p build.js build.native",
"build.debug": "run-s build.js build.native.debug",
"test": "run-s test.unit",
"test.debug": "run-s test.unit.debug",
"test": "run-s test.unit test.examples",
"test.debug": "run-s test.unit.debug test.examples",
"test.unit": "run-s clean.temp build && cross-env INCLUDE_COMPAT_TESTS=true mocha ./test/unit/*-test.ts ./test/unit/compat/*-test.ts",
"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",
"test.unit.nogc": "run-s clean.temp build && cross-env SKIP_GC_TESTS=true mocha",
"test.examples": "cd examples && pnpm install && pnpm run test",
"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",
"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",
"test.smoke": "bash ./script/smoke-test.bash",
Expand Down

0 comments on commit 586fe8d

Please sign in to comment.