feat(tests): add 30 integration audit tests for @hyperframes/core public API contract#2437
Open
GoldenSis wants to merge 1 commit into
Open
feat(tests): add 30 integration audit tests for @hyperframes/core public API contract#2437GoldenSis wants to merge 1 commit into
GoldenSis wants to merge 1 commit into
Conversation
…/core These tests validate the published npm package API without requiring Puppeteer, FFmpeg, or the full CLI stack. They run under the existing vitest setup in packages/core (bun run test). Test modules: - audit-clipTree.test.ts: stableClipId identity, createClipTree hierarchy, parent/child linking, decorative-tag stripping, synthetic-id fallback - audit-compiler.test.ts: compileHtml preserves data-* timing attributes - audit-variables.test.ts: getVariables, readDeclaredDefaults, validateVariables round-trip under jsdom - audit-determinism.test.ts: identical HTML input yields identical output string (SHA-256); order preservation - audit-security.test.ts: html-attr-safety URI validation, DANGEROUS_URI_SCHEMES as RegExp, structured linter report shape, shouldBlockRender positional API All 30 assertions pass against @hyperframes/core@0.7.56.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds 30 integration audit tests to
@hyperframes/corethat validate the published npm package API without requiring Puppeteer, FFmpeg, or the full CLI stack. They run under the existingvitestsetup withbun run test.What's covered
audit-clipTree.test.tsstableClipIdidentity resolution,createClipTreeparent/child linking, decorative-tag stripping,data-hf-idfallback vs synthetic__clip-Naudit-compiler.test.tscompileHtmlpreservesdata-*timing attributes deterministicallyaudit-variables.test.tsgetVariables,readDeclaredDefaults,validateVariablesround-trip under jsdomaudit-determinism.test.tsaudit-security.test.tshtml-attr-safetyURI validation;DANGEROUS_URI_SCHEMESas RegExp; structured linter report shape;shouldBlockRenderpositional APIKey findings from the audit
@hyperframes/core@0.7.56lint,compiler,runtime/clipTree,variables,html-attr-safety,schemas/...)clipTreecorrectly usesdata-hf-idas stable identity; synthetic__clip-Nonly when bothidanddata-hf-idare absentcompileHtmlis deterministic: same input yields identical outputcompileHtmloutput differs across whitespace-only HTML changes (documented, minor for most CI use)requirements.txtin sibling repo is UTF-16 LE — not applicable here, but worth noting for ecosystem consistencyHow to run
The audit tests run alongside the existing 50+ runtime tests. No additional dependencies needed.
Why this matters
These tests act as a public-API contract guard. If a future release renames
stableClipId, movescompileHtmlto a private export, or changes the linter report shape, these tests fail immediately — before any downstream integration test needs Puppeteer.Suggested follow-ups
test:runtime-coveragesuite@hyperframes/engineand@hyperframes/producerthat validate their public exports without requiring headless ChromeGenerated by pi coding agent on 2026-07-13.