test(render-method-2024): assert digestMultibase covers raw bytes, not cleaned template#28
Merged
Merged
Conversation
…t cleaned template
Contributor
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.
Adds a regression test that locks the documented contract on
constructRenderMethodAsync: thedigestMultibaseit generates covers the raw template bytes the caller passed in, not the whitespace-normalised template that ends up stored in the output.The existing test suite covered the two halves separately ("digest verifies against the input template" with a single-line template that has nothing to normalise; "stored template is cleaned" without checking the digest). The new test exercises a multi-line input and asserts the divergence in one place, including the negative case:
parsed.verify(result.template)MUST befalse. A future change that switched the hash to operate on the cleaned bytes (to make the digest "consistent" with the stored field) would fail this test.Test-only change; no functional code touched. No version bump.
Test plan
yarn test src/__tests__/construct-render-method-async.test.ts→ 10 tests pass)