This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
import { describe, expect, it } from 'vitest';
|
||||
import { createCliContext } from '../src/cli/shared.js';
|
||||
|
||||
describe('createCliContext', () => {
|
||||
it('resolves profileName from CLI options before env', () => {
|
||||
const ctx = createCliContext([], { BIRD_PROFILE_NAME: 'env-profile' } as NodeJS.ProcessEnv);
|
||||
|
||||
expect(ctx.resolveProfileNameFromOptions({ profileName: 'cli-profile' })).toBe('cli-profile');
|
||||
});
|
||||
|
||||
it('resolves profileName from env when CLI option is absent', () => {
|
||||
const ctx = createCliContext([], { BIRD_PROFILE_NAME: 'env-profile' } as NodeJS.ProcessEnv);
|
||||
|
||||
expect(ctx.resolveProfileNameFromOptions({})).toBe('env-profile');
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user