Skip to content

Commit 6325e66

Browse files
committed
bugfix-309-setup-crash: Enhance CLI setup test to explicitly check for command line token input, ensuring correct token handling in parameters. Update test to reflect the expected token value for improved clarity and validation.
1 parent 3eac306 commit 6325e66

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/__tests__/cli.test.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,12 +275,18 @@ describe('CLI', () => {
275275
// Token check: hasValidSetupToken/setupEnvFileExists and message variants are covered in
276276
// setup_files.test.ts and initial_setup_use_case.test.ts.
277277
it('calls runLocalAction with INITIAL_SETUP', async () => {
278-
await program.parseAsync(['node', 'cli', 'setup']);
278+
await program.parseAsync([
279+
'node',
280+
'cli',
281+
'setup',
282+
'--token',
283+
'ghp_setup_test_token_xxxxxxxxxxxxxxxxxxxx',
284+
]);
279285

280286
expect(runLocalAction).toHaveBeenCalledTimes(1);
281287
const params = (runLocalAction as jest.Mock).mock.calls[0][0];
282288
expect(params[INPUT_KEYS.SINGLE_ACTION]).toBe(ACTIONS.INITIAL_SETUP);
283-
expect(params[INPUT_KEYS.TOKEN]).toBeTruthy();
289+
expect(params[INPUT_KEYS.TOKEN]).toBe('ghp_setup_test_token_xxxxxxxxxxxxxxxxxxxx');
284290
expect(params[INPUT_KEYS.WELCOME_TITLE]).toContain('Initial Setup');
285291
});
286292

0 commit comments

Comments
 (0)