Skip to content

chore: add native test harness, fixtures, and CI - #14

Merged
robireton merged 1 commit into
mainfrom
chore/test-harness-and-ci
Sep 3, 2026
Merged

chore: add native test harness, fixtures, and CI#14
robireton merged 1 commit into
mainfrom
chore/test-harness-and-ci

Conversation

@robireton

Copy link
Copy Markdown
Owner

Scaffolding for the bug-fix queue (#2#13). No behavior changes to the library — this PR only adds tooling and tests, so it should land first and the six fix PRs will be CI-checked as they open.

What is here

  • npm scriptsnpm run lint (eslint .) and npm test (node --test).
  • .github/workflows/ci.yml — runs lint and tests on push to main and on every PR, on Node 22.
  • test/exports.test.js — asserts every class is exported from index.js, that each subpath export (@robireton/redcap/api, etc.) resolves to that same class, that there is one subpath per class, and that everything in exports is also listed in files. This guards the "update index.js and both maps in package.json" rule from CLAUDE.md.
  • test/fixtures/ — two filesystem-mode projects that exercise REDCapProject’s offline path with no network:
    • project-basic/ — non-longitudinal, one instrument, covering radio, checkbox, yesno, calc, and validated text field types.
    • project-longitudinal/ — two arms, three events, one repeating instrument, plus events.json, arms.json, formEventMapping.json and repeatingFormsEvents.json.

Notes

  • Still zero runtime dependencies. Tests use node:test and node:assert/strict only. The API tests in the follow-up PR will stand up a real node:http server on an ephemeral port rather than pull in an HTTP-mocking library.
  • Nothing new is published. files in package.json is an allowlist, so test/ and .github/ are already excluded from the tarball.
  • Fixtures hold normal REDCap-shaped data. The hostile inputs each bug needs (empty production_time, string "0" flags, malformed choice lists, ragged EAV rows) live inline in the test that covers that bug, so the six fix branches stay independently mergeable.

🤖 Generated with Claude Code

Adds the scaffolding the bug-fix PRs build on:

- npm scripts for `eslint .` and `node --test`
- a GitHub Actions workflow running lint and tests on push/PR
- test/exports.test.js, covering index.js and every subpath export
- test/fixtures/, two filesystem-mode REDCap projects (basic and
  longitudinal) shaped like real API output

No runtime dependencies are added; the tests use node:test and
node:assert only. test/ and .github/ stay out of the published
tarball because "files" in package.json is an allowlist.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant