Skip to content

test: make bun run test independent of a local browser and of example.com's live content - #27

Merged
code-yeongyu merged 2 commits into
mainfrom
fix/26-bsk-snapshot-skip
Sep 29, 2026
Merged

code-yeongyu merged 2 commits into
mainfrom
fix/26-bsk-snapshot-skip

Conversation

@code-yeongyu

@code-yeongyu code-yeongyu commented Sep 29, 2026 •

Copy link
Copy Markdown
Owner

Fixes #26

What changed

The live test in test/bsk-snapshot.test.mjs now carries { skip: !SHELL && "no chromium binary found" }, the same gate every other live-browser test in the suite uses. The pure buildSnapshotExpression test 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 local node:http server instead of https://example.com. example.com removed its <h1>Example Domain</h1> (its page now asks not to be used for testing), so assert.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 test failed on any machine without a local Chromium (clean Linux boxes, CI images, fresh onboarding environments) because withPage() 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/main copy of test/integration.test.mjs fails 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.

@code-yeongyu code-yeongyu changed the title test(bsk): skip the live snapshot test when no browser is found test: make bun run test independent of a local browser and of example.com's live content Sep 29, 2026
@code-yeongyu
code-yeongyu merged commit 9e40291 into main Sep 29, 2026
3 checks passed
@code-yeongyu
code-yeongyu deleted the fix/26-bsk-snapshot-skip branch September 29, 2026 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bun run test fails without a local browser: bsk-snapshot live test asserts instead of skipping

1 participant