Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/commands/login.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -117,14 +117,14 @@ MUX_TOKEN_SECRET = test_secret_456`,
envPath,
`MUX_TOKEN_ID=test_id_123
MUX_TOKEN_SECRET=test_secret_456
MUX_BASE_URL=https://api.staging.mux.com`,
MUX_BASE_URL=https://api.example.com`,
);

const result = await parseEnvFile(envPath);

expect(result.MUX_TOKEN_ID).toBe('test_id_123');
expect(result.MUX_TOKEN_SECRET).toBe('test_secret_456');
expect(result.MUX_BASE_URL).toBe('https://api.staging.mux.com');
expect(result.MUX_BASE_URL).toBe('https://api.example.com');
});

it('should ignore other environment variables', async () => {
Expand Down
7 changes: 3 additions & 4 deletions src/lib/mux.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ import { afterEach, beforeEach, describe, expect, it } from 'bun:test';
import { mkdtemp, rm } from 'node:fs/promises';
import { tmpdir } from 'node:os';
import { join } from 'node:path';
import { getCurrentEnvironment } from './config.ts';
import { setEnvironment } from './config.ts';
import { getCurrentEnvironment, setEnvironment } from './config.ts';
import { DEFAULT_BASE_URL, getMuxBaseUrl } from './mux.ts';

describe('getMuxBaseUrl', () => {
Expand Down Expand Up @@ -54,11 +53,11 @@ describe('getMuxBaseUrl', () => {
await setEnvironment('default', {
tokenId: 'id',
tokenSecret: 'secret',
baseUrl: 'https://api.staging.mux.com',
baseUrl: 'https://config.example.com',
});

const env = await getCurrentEnvironment();
expect(getMuxBaseUrl(env)).toBe('https://api.staging.mux.com');
expect(getMuxBaseUrl(env)).toBe('https://config.example.com');
});

it('should fall back to default when config has no baseUrl', async () => {
Expand Down
Loading