-
Notifications
You must be signed in to change notification settings - Fork 0
Testing
ASN.1 Instance Builder uses TypeScript checks, Vitest tests, and the production build to protect the parser, Schema Model, diagnostics, DER builder, browser application wiring, package entry points, and generated declaration files.
Run the standard checks from the main repository:
npm run check
npm test
npm run buildFor package or release-related changes, also run:
npm run pack:dry-runnpm run check runs:
tsc --noEmitThis verifies the TypeScript project without writing build output.
The check protects exported TypeScript contracts for:
- Core API exports from
@pkistudio/asn1instancebuilderand@pkistudio/asn1instancebuilder/core. -
initAsn1InstanceBuilderfrom@pkistudio/asn1instancebuilder/app. - Schema Model types such as
Asn1SchemaModule,Asn1Type,Asn1Field, andInstanceDocument. - Diagnostics types such as
SchemaDiagnosticandInstanceDiagnostic. - Local PkiStudioJS type definitions.
npm test runs the Vitest suite.
Current tests cover areas such as:
- ASN.1 definition parsing.
- Module headers and tag defaults.
- Explicit, implicit, and automatic tagging behavior.
- Named integer values.
- Negative INTEGER DER encoding.
- Binary input forms and validation.
- Defaults and
ENUMERATEDbehavior. - OID names.
- Schema diagnostics.
- Instance diagnostics.
- PKI component fixtures.
- Minimal
TBSCertificate,Certificate,CertificateList, andCertificationRequestfixtures.
npm run build runs:
npm run build:types && npm run build:lib && npm run build:appThis verifies generated declaration files, library output, browser app output, and standalone viewer output.
The production build covers:
-
index.htmland the browser application shell. -
viewer.htmland standalone PkiStudioJS viewer routing. -
dist/index.js. -
dist/core.js. -
dist/app.js. -
dist/asn1instancebuilder.css. - Type declarations under
dist/types.
The standard checks do not replace full browser verification.
They do not currently cover:
- Full browser UI interaction flows.
- Visual regression checks.
- Clipboard permission behavior across browsers.
- Native download behavior across browsers.
- Popup blocker behavior for standalone PkiStudioJS viewer windows.
- Splitter persistence and layout behavior across viewport sizes.
- Large real-world ASN.1 module corpora.
- Full X.509, CSR, and CRL production-grade profile validation.
Use browser verification when changing menus, clipboard/file flows, definition loading, sample selection, diagnostics rendering, DER build flow, viewer-window routing, API Log behavior, or splitters.
For user-facing application changes, verify the relevant parts of this list:
- Start the app with
npm run dev -- --port 5173 --strictPort. - Load
PersonfromLoad->NamedObjects, build DER, and confirm PkiStudioJS opens. - Load
fixtures/person.definition-bundle.jsonfromLoad->Definition Bundle, confirmPersonis selected with sample input, and build DER. - Load an invalid Definition Bundle JSON file and confirm Definition Bundle diagnostics appear in the Diagnostics pane and API Log.
- Save the active workspace from
Save->Definition Bundleand confirm the exported JSON includes schema source, selected type, and sample input. - Switch between
FormandJSON, edit a value in Form mode, and confirm the JSON view reflects the same instance value. - Enter invalid JSON, switch to
Form, and confirm the Form view reports the parse error without losing JSON editing access. - Load
Certificate, select child types from the Instance Input type selector, and confirm sample input changes when available. - For
Certificate,CertificationRequest,CertificateList, andPkiBundle, switch toFormand confirm representative UI Profile metadata is visible, such as signature labels, PKI section ordering, and collapsed issuer, subject, public key, extension, attribute, or revoked certificate groups. - Load a local
.asn1fixture fromfixtures/. - Load definition text from the clipboard.
- Save the active definition to a file.
- Trigger a schema diagnostic and confirm DER generation is blocked.
- Trigger an instance diagnostic and confirm DER generation is blocked.
- Confirm API Log entries appear for parse, diagnostics, build, viewer opening, and generated DER parsing.
- Confirm pane resizing persists after reload.
In VS Code, the Start asn1instancebuilder server task starts the development server on port 5173.