fix: complete mock.module() exports to prevent CI test failures#11
Merged
guo-yu merged 1 commit intochekusu:mainfrom Mar 31, 2026
Merged
fix: complete mock.module() exports to prevent CI test failures#11guo-yu merged 1 commit intochekusu:mainfrom
guo-yu merged 1 commit intochekusu:mainfrom
Conversation
- Add missing waitForCode to all receive.js mock.module() calls in cli.test.ts - Add missing saveConfig, getConfigValue, setConfigValue, resolveApiKey, CONFIG_DIR, CONFIG_FILE to all config.js mock.module() calls in cli.test.ts - Simplify release.yml test step: use glob pattern (bun test test/unit/) instead of explicit file list to auto-include new test files Bun's mock.module() replaces the module in the global registry. When a mock is missing exports that other test files import, those tests fail with "Export named 'X' not found" in CI where all files run in the same process. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.
Summary
waitForCodeto allreceive.jsmock.module() calls in cli.test.tssaveConfig,getConfigValue,setConfigValue,resolveApiKey,CONFIG_DIR,CONFIG_FILEto allconfig.jsmock.module() calls in cli.test.tsbun test test/unit/) instead of explicit file listRoot cause
Bun's
mock.module()replaces the module in the global registry. When a mock is missing exports that other test files import (e.g.waitForCodefrom receive.js,resolveApiKeyfrom config.js), those tests fail withSyntaxError: Export named 'X' not foundin CI where all files run in the same process.Test plan
bun test test/unit/passes locally (217 tests, 0 failures)bun test test/e2e/flow.test.ts test/e2e/sqlite-search.test.tspasses (16 tests)Generated with Claude Code