Skip to content

Commit 97c52b5

Browse files
committed
test(cli): pin credentials.json winning when --url names the server both stores share
Claude-Session: https://claude.ai/code/session_01VvcEokUG1tvVxkceYfR5XB Co-authored-by: Claude <noreply@anthropic.com>
1 parent dda6991 commit 97c52b5

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

‎packages/cli/src/commands/environments/cloud-session.test.ts‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,15 @@ describe('os environments: the stored session it authenticates with', () => {
266266
expect(cloudPlane.seen[0].environmentId).toBe('env_from_credentials_json');
267267
});
268268

269+
it.each(SUBCOMMANDS)('%s: credentials.json wins where both name the --url server', async (name, run) => {
270+
await writeCloud({ url: cloudPlane.url, token: 'cloud_tok' });
271+
await writeCredentials({ url: cloudPlane.url, token: 'runtime_tok' });
272+
273+
const outcome = await invoke(run, ['--url', cloudPlane.url]);
274+
275+
expectServedBy(name, outcome, cloudPlane, runtimePlane, 'runtime_tok');
276+
});
277+
269278
it.each(SUBCOMMANDS)('%s: with no --url, credentials.json still picks the server', async (name, run) => {
270279
await writeCloud({ url: cloudPlane.url, token: 'cloud_tok' });
271280
await writeCredentials({ url: runtimePlane.url, token: 'runtime_tok' });

0 commit comments

Comments
 (0)