Skip to content

Commit a26e57d

Browse files
committed
test: fix help test to work with compiled version
1 parent 7c3a525 commit a26e57d

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

test/commands/init.test.ts

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,16 @@ describe('init', () => {
2525

2626
describe('help', () => {
2727
it('shows help information', async () => {
28-
const {stdout} = await runCommand(['init', '--help'])
29-
expect(stdout).to.contain('Initialize Claude Code hooks')
30-
expect(stdout).to.contain('--force')
28+
try {
29+
const {stdout} = await runCommand(['init', '--help'])
30+
expect(stdout).to.contain('Initialize Claude Code hooks')
31+
expect(stdout).to.contain('--force')
32+
} catch (error) {
33+
// Fallback to testing with execSync for compiled version
34+
const output = execSync(`node ${binPath} init --help`, {encoding: 'utf8'})
35+
expect(output).to.contain('Initialize Claude Code hooks')
36+
expect(output).to.contain('--force')
37+
}
3138
})
3239
})
3340

0 commit comments

Comments
 (0)