-
Notifications
You must be signed in to change notification settings - Fork 0
Testing
Certificate Gadgets currently uses TypeScript checks and the production build to protect the public package contract, browser application wiring, reusable API surface, and generated declaration files.
Run the standard checks from the main repository:
npm run check
npm run buildThere is not currently a separate npm test script. Treat npm run check and npm run build as the required baseline before handing normal code changes back.
npm run check runs:
tsc --noEmitThis verifies the TypeScript project without writing build output.
The check protects exported TypeScript contracts for:
-
CertGadgetsCorefrom@pkistudio/certgadgetsand@pkistudio/certgadgets/core. -
CertGadgetsValidationfrom@pkistudio/certgadgets/validation. -
initCertificateGadgetsfrom@pkistudio/certgadgets/app. - Local PkiStudioJS viewer type definitions.
The check helps keep browser application code aligned with host callback types such as network confirmation and network fetching.
VS Code-specific lifecycle, dialogs, and network transport behavior should remain outside this package and flow through host callbacks.
The check protects TypeScript shapes used for:
- X.509 certificate documents.
- Certificate tree nodes.
- Extension details and network resources.
- Network validation plans.
- Validation result assessments and artifacts.
npm run build runs:
tsc --noEmit
vite build
tsc -p tsconfig.types.jsonThis verifies both the browser bundle and generated declaration files.
The production build covers the browser application entries:
-
index.htmlandsrc/main.tsfor the main Certificate Gadgets app. -
viewer.htmlandsrc/viewer.tsfor the standalone PkiStudioJS viewer page.
The build verifies that package outputs can be produced for:
-
dist/core.js. -
dist/validation.js. -
dist/app.js. -
dist/styles.css.
It also generates declaration files through tsconfig.types.json.
The build catches integration issues with browser-shipped dependencies such as:
-
@pkistudio/pkistudiojs. -
asn1js. -
pkijs. -
pvtsutils.
The current 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 save-file picker behavior and download fallback behavior.
- Real-world certificate corpora.
- Real-world OCSP, AIA, and CRL responder behavior.
- CORS and proxy deployment behavior outside local development.
- Validation artifact viewer routing across browser windows.
- Splitter persistence and layout behavior across viewport sizes.
Use browser verification when changing menus, dialogs, clipboard flows, save behavior, tree selection, splitters, embedded PkiStudioJS behavior, extension decoding, validation actions, or artifact opening.
For user-facing application changes, verify the relevant parts of this list:
- Load
fixtures/debug-certificate.derorfixtures/debug-certificate.pem. - Select root certificate and TBSCertificate child nodes and confirm the detail pane updates.
- Select common extensions and confirm decoded summaries are readable.
- Confirm the embedded ASN.1 viewer updates when DER-backed tree items are selected.
- Save the loaded certificate as PEM.
- Save a selected DER-backed tree item as DER.
- Run an explicit validation action when a certificate contains a reachable AIA, OCSP, or CRL URL.
- Confirm validation results and transcripts appear in the Validation pane.
- Open validation artifacts in the appropriate Certificate Gadgets or ASN.1 viewer path.
- Clear validation results and API log entries.
For package or release-related changes, also run:
npm run pack:dry-runUse the local development server when browser verification is needed:
npm run dev -- --port 5173 --strictPortThen open:
http://localhost:5173/
In VS Code, the Start certgadgets server task starts the same server.