Skip to content

Commit e873b36

Browse files
committed
feat(tests): update Node.js test commands to include CI environment variable for non-interactive execution
1 parent afe4087 commit e873b36

5 files changed

Lines changed: 12 additions & 6 deletions

File tree

src/klondike_spec_cli/cli.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -878,7 +878,8 @@ def _feature_prompt(
878878
"",
879879
"3. **Run tests:** Verify all tests pass",
880880
" - Python: `uv run pytest`",
881-
" - Node.js: `npm test`",
881+
" - Node.js (Bash): `CI=true npm test`",
882+
" - Node.js (PowerShell): `$env:CI='true'; npm test`",
882883
"",
883884
"4. **Build (if applicable):** Ensure project builds",
884885
" - Node.js: `npm run build`",

src/klondike_spec_cli/templates/github_templates/copilot-instructions.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,9 +105,14 @@ Before running checks, detect available commands:
105105
|-------|-------------|--------------|---------|------|----|
106106
| Lint | `uv run ruff check src tests` | `ruff check` or `flake8` | `npm run lint` | `cargo clippy` | `golangci-lint` |
107107
| Format | `uv run ruff format --check src tests` | `ruff format --check` | `npm run format` | `cargo fmt --check` | `gofmt -l` |
108-
| Test | `uv run pytest` | `pytest` | `npm test` | `cargo test` | `go test` |
108+
| Test | `uv run pytest` | `pytest` | `CI=true npm test` (PowerShell: `$env:CI='true'; npm test`) | `cargo test` | `go test` |
109109
| Build | N/A (interpreted) | N/A | `npm run build` | `cargo build` | `go build` |
110110

111+
**Note on CI environment variable:**
112+
- **Bash/Linux/macOS**: `CI=true npm test`
113+
- **PowerShell/Windows**: `$env:CI='true'; npm test`
114+
- Setting `CI=true` prevents interactive prompts in test runners like Jest
115+
111116
### Step 3: Record Results Before Commit
112117

113118
**You MUST record each command's result:**

src/klondike_spec_cli/templates/github_templates/instructions/worktree-practices.instructions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ Before ending a worktree session, always run tests:
7777
uv run pytest tests/ -v
7878

7979
# Node.js projects
80-
npm test
80+
CI=true npm test
8181
```
8282

8383
### Verify Lint/Format

src/klondike_spec_cli/templates/github_templates/prompts/continuous-implementation.prompt.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ git status
9292
9393
# Run project tests
9494
# Python: uv run pytest
95-
# Node.js: npm test
95+
# Node.js: CI=true npm test # Prevents interactive prompts
9696
9797
# Run linting
9898
# Python: uv run ruff check src tests
@@ -329,7 +329,7 @@ klondike feature list --status not-started | head -5
329329
klondike copilot start -w --apply --feature F001
330330
331331
# After it completes, verify and commit
332-
git status && npm test && git add -A && git commit -m "feat(F001): implement feature"
332+
git status && CI=true npm test && git add -A && git commit -m "feat(F001): implement feature"
333333
klondike feature verify F001 --evidence "tests pass"
334334
335335
# Repeat for next feature

src/klondike_spec_cli/templates/github_templates/prompts/session-end.prompt.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ uv run pytest
2828

2929
# Example for Node.js:
3030
npm run build
31-
npm test
31+
CI=true npm test
3232
npm run lint
3333
```
3434

0 commit comments

Comments
 (0)