Skip to content

Commit af46aff

Browse files
committed
fix(test): resolve binCliPath undefined errors and CI shimmer test
Fix three test issues preventing CI success: 1. binCliPath undefined errors (23 tests): - test/helpers/cli-execution.mts: Change from destructuring to function call - test/run-with-config.mts: Change from destructuring to function call - Root cause: binCliPath is a function, not a property 2. Shimmer animation test failure: - src/utils/terminal/ascii-header.test.mts: Add CI environment check - In CI, applyShimmer renders static output for determinism - Test now expects identical frames when CI=true
1 parent 4c1a3f3 commit af46aff

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

packages/cli/src/utils/terminal/ascii-header.test.mts

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,15 @@ describe('ascii-header', () => {
148148
it('should render different frames differently', () => {
149149
const frame0 = renderShimmerFrame(0)
150150
const frame10 = renderShimmerFrame(10)
151-
// Shimmer animation should produce different output for different frames
152-
expect(frame0).not.toBe(frame10)
151+
// Shimmer animation should produce different output for different frames.
152+
// In CI environments, applyShimmer renders static output for deterministic tests.
153+
if (process.env['CI']) {
154+
// In CI, frames should be identical (static rendering).
155+
expect(frame0).toBe(frame10)
156+
} else {
157+
// Outside CI, frames should differ (animated rendering).
158+
expect(frame0).not.toBe(frame10)
159+
}
153160
})
154161

155162
it('should render shimmer with all themes', () => {

packages/cli/test/helpers/cli-execution.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export async function executeCliCommand(
6969
...options,
7070
} as CliExecutionOptions
7171

72-
const { binCliPath } = constants
72+
const binCliPath = constants.getBinCliPath()
7373
const finalArgs = [...args]
7474

7575
// Add config isolation if requested

packages/cli/test/run-with-config.mts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ import constants from '../src/constants.mts'
3030
* @returns Object containing exitCode, stdout, and stderr.
3131
*/
3232
export async function runWithConfig(...args: string[]) {
33-
const { binCliPath } = constants
33+
const binCliPath = constants.getBinCliPath()
3434
// Add --config {} if not present.
3535
if (!args.includes('--config')) {
3636
args.push('--config', '{}')

0 commit comments

Comments
 (0)