Skip to content

Move mdocContext unit tests into mocha test suite.#223

Open
djscruggs wants to merge 1 commit into
mainfrom
djscruggs/issue-222-move-mdoc-context-tests
Open

Move mdocContext unit tests into mocha test suite.#223
djscruggs wants to merge 1 commit into
mainfrom
djscruggs/issue-222-move-mdoc-context-tests

Conversation

@djscruggs

Copy link
Copy Markdown
Contributor

Converts the standalone test/unit/mdocContext.test.js (added in #219) into a standard mocha suite at test/mocha/91-mdoc-context.js so it runs under the common testing system, npm test, and CI.

  • Replaces the ad-hoc test()/assert() harness with describe/it and chai should assertions; test behaviors are unchanged (sign an mDL via mdocContext, verify against a trusted chain, reject an untrusted certificate).
  • Hoists the repeated PEM-to-DER helper, device JWK, and signing boilerplate into shared helpers.
  • Removes the test:unit script and the test/unit/ directory; no references remain.

There was no strong reason for the standalone runner beyond skipping Bedrock stack startup during development — --mocha-test covers that need without a parallel test system.

Closes #222.

🤖 Generated with Claude Code

Converts the standalone test/unit/mdocContext.test.js (added in PR #219)
into a standard mocha suite at test/mocha/91-mdoc-context.js so it runs
under the common testing system, npm test, and CI. Removes the ad-hoc
test:unit script and the test/unit directory.

Addresses #222.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 91.95%. Comparing base (1b033be) to head (7301bb9).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #223   +/-   ##
=======================================
  Coverage   91.95%   91.95%           
=======================================
  Files          18       18           
  Lines        3678     3678           
=======================================
  Hits         3382     3382           
  Misses        296      296           

Continue to review full report in Codecov by Harness.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1b033be...7301bb9. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@djscruggs
djscruggs requested a review from davidlehn July 7, 2026 18:41
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.

Move mdocContext.test.js tests into main tests.

2 participants