Skip to content

test: boot the built app in CI so a blank window fails the build - #31

Merged
killerwolf merged 1 commit into
mainfrom
test/electron-boot-smoke
Sep 7, 2026
Merged

test: boot the built app in CI so a blank window fails the build#31
killerwolf merged 1 commit into
mainfrom
test/electron-boot-smoke

Conversation

@killerwolf

Copy link
Copy Markdown
Owner

Closes the gap that let #29 through.

The gap

The preload bug fixed in #29 made the app open to a blank window — and every check in CI passed on it:

Check Why it missed the bug
npm run lint / check it's valid, well-formatted code
npm run typecheck import { CHANNELS } from "./ipc-types" is valid TypeScript
npm test the unit tests never boot Electron
npm run pack builds the app without launching it

Nothing in the pipeline ever started the app.

What this adds

npm run test:smoke boots the real dist/main.js — not a reimplementation of it — and asserts the renderer actually came up:

  • the preload loaded without a preload-error
  • contextBridge exposed window.electronAPI
  • every key in CHANNELS is present on it, read from the compiled ipc-types, so a channel added to the contract without reaching the renderer fails here too
  • #root has content, i.e. React mounted

Runs in CI right after npm run pack, which has already produced dist/.

Verified to actually fail

A test that can't fail is worthless, so I reintroduced the exact regression (rebuilding the preload with plain tsc) and confirmed it exits 1 with a diagnostic that names the cause:

Smoke test: booting the built app
  ok    the renderer finished loading
  FAIL  the preload script loaded — dist/preload.js: module not found: ./ipc-types
  FAIL  contextBridge exposed window.electronAPI — got undefined
  FAIL  React mounted and rendered — #root is empty
Smoke test failed (3).

Against main as it now stands, it passes all five assertions.

🤖 Generated with Claude Code

#29 fixed a preload that threw on load, leaving window.electronAPI
undefined and the renderer dead on its first property access — the app
opened to a blank window. Every existing check passed on it: the import
was valid TypeScript, the unit tests never boot Electron, and `npm run
pack` builds the app without launching it.

Adds `npm run test:smoke`, which boots the real dist/main.js and asserts
the renderer actually came up: the preload loaded without error, every
CHANNELS key is exposed on window.electronAPI, and #root has content.
It reads the channel list from the compiled ipc-types, so a channel
added to the contract without reaching the renderer fails here too.

Verified against the regression itself — rebuilding the preload with
plain tsc makes it exit 1 and name the cause:

  FAIL  the preload script loaded — module not found: ./ipc-types
  FAIL  contextBridge exposed window.electronAPI — got undefined
  FAIL  React mounted and rendered — #root is empty

Runs after the pack step, which has already produced dist/.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@killerwolf
killerwolf merged commit 8c73082 into main Sep 7, 2026
2 checks passed
@killerwolf
killerwolf deleted the test/electron-boot-smoke branch September 7, 2026 13:58
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.

1 participant