Skip to content

Commit bce9098

Browse files
committed
fix: run build before smoke test
1 parent c36bdff commit bce9098

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,5 +54,8 @@ jobs:
5454
- name: Install dependencies
5555
run: pnpm install --frozen-lockfile
5656

57+
- name: Build project
58+
run: pnpm run build
59+
5760
- name: Run smoke tests
58-
run: pnpm run test:smoke
61+
run: pnpm exec mocha --forbid-only "test/smoke/**/*.test.ts"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"postpack": "shx rm -f oclif.manifest.json",
7575
"posttest": "pnpm run lint",
7676
"prepack": "pnpm run build && oclif manifest && oclif readme",
77-
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
77+
"test": "mocha --forbid-only \"test/**/*.test.ts\" --exclude \"test/smoke/**/*\"",
7878
"test:unit": "mocha --forbid-only \"test/**/*.test.ts\" --exclude \"test/integration/**/*\" --exclude \"test/smoke/**/*\"",
7979
"test:smoke": "pnpm run build && mocha --forbid-only \"test/smoke/**/*.test.ts\"",
8080
"version": "oclif readme && git add README.md"

test/smoke/cli.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ const execAsync = promisify(exec)
99
/**
1010
* Verify that build artifacts exist
1111
* This is a prerequisite for smoke tests
12+
* Throws an error if build artifacts are missing
1213
*/
1314
function ensureBuildExists(): void {
1415
// Use process.cwd() which works in both CommonJS and ES modules
@@ -47,6 +48,7 @@ describe('Smoke Tests: Built CLI Binary', () => {
4748

4849
before(() => {
4950
// Ensure build exists before running tests
51+
// This will throw an error if build is missing, causing tests to fail explicitly
5052
ensureBuildExists()
5153
})
5254

0 commit comments

Comments
 (0)