Repository navigation
Make the tests check what they claim (land #78 on master) - #79
Merged
Merged
Conversation
Several tests passed whether or not the feature worked (#76): - "should render the PDF file" opened a PDF that exists nowhere and asserted inside a handler it never awaited. It now opens a PDF in the repository and waits for a page to be drawn. - "should not render PDF with wrong url" asserted before the load could finish. It now waits for the load to fail, and fails if pages load. - "should open the external file with base64 source": getFileData() fetched the base64 string as a relative URL, and PDF.js 6 rejects a bare Uint8Array. It now opens { data } and checks the document's text. - "defaults to resources that ship next to the runtime files" checked HEAD for a 200, which the dev server also returns for a missing file. It now checks the content type. - 14 tests set src to a missing PDF they didn't need; that's removed. PdfViewerApplicationOpenParameters no longer allows a bare Uint8Array, which PDF.js rejects at runtime. Closes #76 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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
#78 merged into
chore/pdfjs-6.5.438, but #77 had already merged that branch intomaster. The commit therefore never reachedmaster, and #76 is still open. This PR brings the same commit, b582384, tomasterunchanged. The full description and review are on #78.Closes #76.
The commit fixes four tests that passed whether or not their feature worked:
documenterrorand fails if pages load instead.{ data }and checks for the document's own text.It also removes the missing PDF from 14 tests that don't need a document. It drops
Uint8ArrayfromPdfViewerApplicationOpenParameters, because PDF.js 6 rejects it at runtime.Validation
masterhas the same tree as the commit's parent, so merging this PR produces exactly the tree that run tested.pnpm test -- --run, also run withpublic/moved away. Each rewritten test was checked to fail with its feature broken.pnpm exec tsc --noEmitandpnpm buildalso passed.Checklist
open({ data }).🤖 Generated with Claude Code