test: add fixture remediation scan tests#546
Conversation
|
Thanks for picking up issue #540 — the test structure is solid and the coverage is exactly what was asked for. One issue before this can merge: the A few other things to address:
If you'd like to contribute an additional fixture, fixtures #2, #3, #8, #9, and #12 are still open in discussion #528 — happy to assign one to you. |
ebcaee1 to
7584ed9
Compare
|
Pushed 7584ed9 and updated the title. The branch is rebased on main; loadFixture now uses searchDepth 4, the string-width case now uses firstFixedVersion 7.2.1, and this branch's copy of examples/yarn-within-range was removed. PR #537 is still open, so the full fixture test has that one yarn case blocked until the shared fixture lands. Test: npm test -- tests/fixture-scan.test.ts --runInBand -t "wrong-parent|direct dependency|transitive-only|no-findings" -> 4 passed, 1 skipped. |
7584ed9 to
e04834c
Compare
sonukapoor
left a comment
There was a problem hiding this comment.
All feedback addressed - title, search depth, string-width version, fixture conflict resolved. CI is clean and the yarn test self-guards with itWithFixture until #537 lands.
|
Merged — thank you @nkgotcode! |
Summary
Adds fixture-scan coverage for remediation command planning across the existing example fixtures, including npm direct, npm transitive, npm within-range, and Yarn within-range cases.
Why this change
Issue #540 asks for integration-style tests that scan example fixtures and assert the expected output behavior. The new test loads fixture lockfiles through the parser layer, builds minimal findings, and checks the remediation command plan without relying on OSV/network calls.
What changed
tests/fixture-scan.test.tscoveringwrong-parent,direct-fixable,transitive-only,no-findings, andyarn-within-rangefixtures.examples/yarn-within-rangeYarn Classic fixture so the Yarn lockfile refresh behavior is covered in this PR.Validation
npm test -- tests/fixture-scan.test.ts --runInBandnpm test -- tests/parsers.test.ts tests/fix-commands-subfolder.test.ts tests/fixture-scan.test.ts --runInBandnpm run buildUser-facing impact
Does this change:
Notes
Closes #540.