Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -95,23 +95,16 @@ jobs:
- name: Install dependencies
run: npm ci --ignore-scripts --prefer-offline --no-audit --no-fund

- name: Run tests (Jest on base, Vitest on head during cutover)
- name: Run tests (Vitest on head and base)
env:
EVENT_NAME: ${{ github.event_name }}
TARGET: ${{ matrix.target }}
run: |
# During Jest-to-Vitest cutover: base contains jest.mock() calls,
# head contains vi.* mocks. Use Jest baseline to ensure head comparison
# is valid. Once base catches up, simplify to Vitest everywhere.
# Head and base must use the same runner, or the comparison job
# reports every failure that only one runner can see as "new".
# Jest's testMatch covers *.test.js only, so a Jest base never ran
# the TypeScript suites. The base branch now runs under Vitest.
test_status=0

if [ "$TARGET" = "base" ]; then
# Base revision still has jest.mock() — must run Jest
npx jest --config jest.config.js --ci --json --outputFile=jest-report.json || test_status=$?
else
# Head revision has vi.* mocks — run Vitest
npx vitest run --reporter=json --outputFile=jest-report.json --coverage=false || test_status=$?
fi
npx vitest run --reporter=json --outputFile=jest-report.json --coverage=false || test_status=$?

# Report summary and detect empty suites
num_suites=$(jq '.numTotalTestSuites // (.testResults | length)' jest-report.json 2>/dev/null || echo 0)
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

### Changed

- **CI: Vitest runs on both sides of the test comparison** — `.github/workflows/tests.yml` ran Jest on the base branch and Vitest on the PR head. Jest's `testMatch` covers `*.test.js` only, so TypeScript suites never ran on base, and any failure in them was reported as new on every PR. Base now runs Vitest too; `main` passes the full Vitest suite.
- **Reader access: Restricted chapter bundling** (RA-T054) — Temporarily set `BOOK_SOURCE_DIRECTORIES` to empty array to prevent protected chapters from being bundled in the client. Chapters are now served exclusively through `/api/reader/chapters/{chapterId}` pending implementation of server-side delivery (RA-T035/RA-T037). Satisfies RA-001 (verified access only) and SC-004 (authorization required for direct chapter access).
- **Constitution Amendment v1.0.1** — Updated Principle IV (Protected Content & Data Rules) to reflect `src/content/` as canonical editorial content location per PR #608. Aligns repository practice with governance framework.
- Repository governance configuration now fetched from canonical `lightspeedwp/.github` (Phase 2 consolidation — v1.0.0 release verification)
Expand Down
Loading