Skip to content

Testing

dweller long gone edited this page May 23, 2026 · 1 revision

Testing

Run the standard local checks before handing normal code changes back:

npm run check
npm test
npm run build
npm run smoke

For package or release-related changes, also run:

npm run pack:dry-run

What the Tests Cover

The Vitest suite covers core behavior such as:

  • candidate ranking,
  • feature extraction,
  • document hypotheses,
  • report generation,
  • PKI corpus behavior,
  • PkiStudioJS adapter contracts.

Relevant test files live under test/.

Smoke Test

The smoke command builds the package and runs a real DER hex fragment through the public API.

Expected behavior: the sample AlgorithmIdentifier fragment should report PkiComponents.AlgorithmIdentifier as the best candidate.

Browser Verification

Run the local viewer with:

npm run dev -- --port 5173 --strictPort

Then open:

http://localhost:5173/

Use the embedded PkiStudioJS viewer's Load menu to load sample DER/HEX input and confirm that the candidate tree, selected details, copy JSON, and API log update.

GitHub Pages Build

Build the Pages viewer locally with:

npm run build:pages

The Pages workflow publishes the pages-dist artifact.

Package Verification

After publication, verify npm package state with:

npm view @pkistudio/asn1defsifter@<version> version dist-tags dist.tarball --json

Clone this wiki locally