test: boot the built app in CI so a blank window fails the build - #31
Merged
Conversation
#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>
This was referenced Sep 7, 2026
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.
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:
npm run lint/checknpm run typecheckimport { CHANNELS } from "./ipc-types"is valid TypeScriptnpm testnpm run packNothing in the pipeline ever started the app.
What this adds
npm run test:smokeboots the realdist/main.js— not a reimplementation of it — and asserts the renderer actually came up:preload-errorcontextBridgeexposedwindow.electronAPICHANNELSis present on it, read from the compiledipc-types, so a channel added to the contract without reaching the renderer fails here too#roothas content, i.e. React mountedRuns in CI right after
npm run pack, which has already produceddist/.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:Against
mainas it now stands, it passes all five assertions.🤖 Generated with Claude Code