Skip to content

fix(integration-tests): use node: prefix to bypass bun module mocks#412

Merged
bakeb7j0 merged 1 commit intokahuna/390-bug-drainfrom
fix/integration-tests-node-prefix
May 6, 2026
Merged

fix(integration-tests): use node: prefix to bypass bun module mocks#412
bakeb7j0 merged 1 commit intokahuna/390-bug-drainfrom
fix/integration-tests-node-prefix

Conversation

@bakeb7j0
Copy link
Copy Markdown
Contributor

@bakeb7j0 bakeb7j0 commented May 6, 2026

Summary

Third hotfix attempt for the kahuna→main blocking integration tests. CI failed with:

SyntaxError: Export named 'spawnSync' not found in module 'node:child_process'.

Root Cause

Other test files (notably pr-merge-github.test.ts) call mock.module('child_process', () => ({ execSync: mockExecSync })). This mock leaks across bun's shared test-runner module space. The mock only exports execSync, so when cli-flag-shapes.test.ts imports spawnSync from 'child_process' (no prefix), it hits the partial mock and the import fails.

This explains why local tests passed (test ordering happened to load the integration test before the mock was registered) but CI failed (different test order).

Fix

Use the node:child_process prefix which forces explicit Node built-in resolution and bypasses bun's module mock layer.

Tests

CI failed with: SyntaxError: Export named 'spawnSync' not found in
module 'node:child_process'. Root cause: pr-merge-github.test.ts (and
other test files) call mock.module('child_process', ...) which leaks
across bun's shared test-runner module space. The mock only exports
execSync, so when this integration test imports spawnSync without
the node: prefix, it resolves to the partial mock and the import fails.

The node: prefix forces explicit Node built-in resolution, bypassing
the mock. This is the correct fix per Bun's mocking documentation.
@bakeb7j0 bakeb7j0 merged commit 89c2f74 into kahuna/390-bug-drain May 6, 2026
1 check failed
@bakeb7j0 bakeb7j0 deleted the fix/integration-tests-node-prefix branch May 6, 2026 02:11
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.

2 participants