test: collocate primitives tests and add BDD steps to OpenSpec tests#39
Open
stevenobiajulu wants to merge 3 commits intomainfrom
Open
test: collocate primitives tests and add BDD steps to OpenSpec tests#39stevenobiajulu wants to merge 3 commits intomainfrom
stevenobiajulu wants to merge 3 commits intomainfrom
Conversation
…ntation Move all 34 test files from packages/docx-core/test-primitives/ into packages/docx-core/src/primitives/ so tests live alongside the code they exercise. This eliminates the test-primitives/ directory entirely. Key changes: - Create src/primitives/testing/allure-test.ts with defaultEpic 'DOCX Primitives' - Move 21 direct 1:1 test files with import path updates - Move 7 suffixed test files (.branch, .traceability) preserving suffixes - Rename delete_comment.test.ts → comments.delete.test.ts - Rename insert_paragraph_style_source.traceability.test.ts → document.traceability.test.ts - Split normalization.test.ts: mergeRuns tests → merge_runs.test.ts, simplifyRedlines tests → simplify_redlines.test.ts - Split document_view_formatting.test.ts: computeModalBaseline tests → formatting_tags.test.ts, remainder → document_view.formatting.test.ts - Merge test-primitives/comments.test.ts into existing src/primitives/comments.test.ts - Merge unique UNSAFE_CONTAINER_BOUNDARY test from test-primitives/text.test.ts - Update vitest.config.ts and vitest.baseline.config.ts packageNameOverrides - Update validate_primitives_openspec_coverage.mjs TEST_ROOT and matrix path - Update existing src/primitives tests to use primitives allure helper - Delete test-primitives/ directory, helpers, and setup files All 805 tests pass (804 + 1 skip). Spec coverage: 41/41 canonical scenarios.
- Add allureStep Given/When/Then calls to all 18 OpenSpec test files across docx-core and docx-mcp so Allure reports show visible BDD steps - Fix duplicate .openspec() label: 'Building footnote mapping' → 'Building footnote mapping preserves document order' - Delete stale normalization.test.ts (content merged into merge_runs.test.ts and simplify_redlines.test.ts in prior commit) validate_allure_test_quality.mjs --strict: 0 errors docx-core: 804 pass, 1 skip | docx-mcp: 611 pass
…iles Fix unused imports (itAllure, FontBaseline, serializeXml, W, getBody) and add non-null assertions for array access in test assertions to satisfy strict TypeScript checking after test collocation.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
packages/docx-core/test-primitives/intopackages/docx-core/src/primitives/so tests live next to the code they exercise. Eliminates thetest-primitives/directory entirely.allureStepGiven/When/Then calls to all 18 OpenSpec test files (across docx-core and docx-mcp) so Allure reports show visible BDD steps instead of "No test steps information available.".openspec('Building footnote mapping')→'Building footnote mapping preserves document order'What changed
test-primitives/→src/primitives/git mv, preserving rename historysrc/primitives/testing/allure-test.tsdefaultEpic: 'DOCX Primitives'vitest.config.ts/vitest.baseline.config.tspackageNameOverridesupdated to key onsrc/primitivesvalidate_primitives_openspec_coverage.mjsTEST_ROOTupdated tosrc/primitivesallureStepBDD steps to all.openspec()testsnormalization.test.tsmerge_runs.test.ts+simplify_redlines.test.ts)Verification
validate_allure_test_quality.mjs --strict: 0 errorscheck:spec-coverage --strict: all scenarios coverednpm run lint:workspaces: 0 TypeScript errorsTest plan
npm run buildpassesnpm run lint:workspaces— 0 errorsnpx vitest runin docx-core — 793 tests passnpx vitest runin docx-mcp — 611 tests passnpm run check:spec-coverage -w @usejunior/docx-core -- --strict— all coverednode scripts/validate_allure_test_quality.mjs --strict— 0 errorstest-primitives/directory no longer exists