Repository navigation
Add basic CI workflow and fixture unit tests - #62
Merged
Merged
Conversation
Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues with the CI, fixture-test, and offline CLI-test changes.
No open issues 🎉
What changed in this PR
Adds a basic CI pipeline and automated assertions for the toolkit’s shipped fixtures and offline CLI behavior, without introducing test dependencies.
Changes:
- Runs package restore, build, and tests on Node 22.x and 24.x, with pinned GitHub Actions and Dependabot updates.
- Adds fixture and CLI tests alongside the existing harness scripts.
- Documents testing procedures and corrects README output to include both default-branch and
testbranch matches.
| File | Description |
|---|---|
TESTING.md |
Documents test commands, coverage, fixtures, and manual API testing. |
src/fixtures.test.ts |
Adds assertions for fixture loading, matching, ignore rules, and PURL searches. |
src/cli.test.ts |
Tests offline CLI matching, JSON search output, and no-match behavior. |
README.md |
Updates test instructions and corrects fixture output examples. |
package.json |
Adds the new test files to the existing test command. |
CHANGELOG.md |
Records CI, test coverage, and documentation changes. |
.github/workflows/ci.yml |
Adds package restore, build, and test jobs for Node 22.x and 24.x. |
.github/dependabot.yml |
Adds weekly updates for GitHub Actions dependencies. |
Review effort: Balanced
Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
…esting Co-authored-by: felickz <1760475+felickz@users.noreply.github.com>
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.
The repo had no CI and no assertions around the shipped fixtures. This adds a minimal build/test pipeline and unit tests that verify package restore works and that the existing fixtures behave as documented.
CI (
.github/workflows/ci.yml)main, pull requests and manual dispatch, across Node 22.x and 24.xnpm ci(package restore, validates lockfile is in sync),npm run build,npm testgithub-actionsDependabot ecosystem was added so the pins stay currentUnit tests
Node's built-in test runner (
node:test+node:assert/strict), so no new dependencies:src/fixtures.test.tscovers loading the SBOM and advisory fixtures, branch diff revival into aMap, malware matching plus the--malware-cutoffboundary, the shippedignore.example.yml, and PURL search (exact / semver range / wildcard / no-match)src/cli.test.tsspawns the built CLI offline against the fixtures exactly as the README documents, asserting malware match lines, JSON search output and the no-match pathnpm testnow runs these alongside the two pre-existing harness scripts, which are unchanged:Test files are listed explicitly rather than globbed, since positional glob handling in
node --testvaries by Node version and shell.Documentation
chalk-org/chalk-repo, single match). The fixtures produceadvanced-security/test-sbom-repowith a default-branch match and atestbranch matchTESTING.md, whichCONTRIBUTING.mdalready linked to but did not existNot included
npm run lintis currently broken (ESLint 9 requires a flateslint.config.js; the repo still has.eslintrc.json), so lint is intentionally omitted from the workflow. That migration would touch source across the repo and seems better as its own change. Related:CONTRIBUTING.mdreferences alint:fixscript that does not exist.