Repository navigation
test: make bun run test independent of a local browser and of example.com's live content - #27
Merged
Merged
Conversation
example.com dropped its <h1>, so the snapshot heading assertion failed on every run.
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.
Fixes #26
What changed
The live test in
test/bsk-snapshot.test.mjsnow carries{ skip: !SHELL && "no chromium binary found" }, the same gate every other live-browser test in the suite uses. The purebuildSnapshotExpressiontest and the in-page-failure test are unchanged and still run everywhere.Also:
test/integration.test.mjs"pipe transport drives Chromium with zero listening TCP ports" now navigates to a page served from a localnode:httpserver instead ofhttps://example.com. example.com removed its<h1>Example Domain</h1>(its page now asks not to be used for testing), soassert.ok(tree.includes('heading "Example Domain"'))fails on every run, main included. This PR's first CI run failed on exactly that line.Why
bun run testfailed on any machine without a local Chromium (clean Linux boxes, CI images, fresh onboarding environments) becausewithPage()asserts a browser exists and this test had no skip gate.QA
No browser (clean Ubuntu 24.04, aarch64):
bun run test->174 pass / 28 skip / 0 fail, exit 0, with(skip) bskSnapshot through a main-world Runtime.evaluate .... Before the fix:174 pass / 27 skip / 1 fail, exit 1.With a browser (macOS, Chrome present):
bun test test/bsk-snapshot.test.mjs->3 pass / 0 fail; the live test runs and passes (354 ms).example.com fix, red/green: the
origin/maincopy oftest/integration.test.mjsfails locally at:72(AssertionError: false == true); the patched file passes (2 pass / 0 fail) against a real Chrome.Residual risk
None beyond the existing behavior of the sibling live tests: without a browser this test no longer exercises the live path.