Skip to content

Commit 7546eb8

Browse files
committed
Fix success output assertions with CI colors enabled
1 parent c532e9f commit 7546eb8

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎packages/void/test/unit/login-command.test.ts‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { beforeEach, describe, expect, it, vi } from 'vite-plus/test';
22
import { promptForLoginToken, runLoginCommand } from '../../src/cli/login.ts';
3+
import { pc } from '../../src/cli/output.ts';
34

45
const mockWarn = vi.fn();
56
const mockError = vi.fn();
@@ -170,8 +171,9 @@ describe('runLoginCommand', () => {
170171
expect(mockDiscoverPlatform).toHaveBeenCalledWith('https://api.example.test');
171172
expect(mockRunLogin).toHaveBeenCalledWith(root, 'github', expect.any(Function));
172173
expect(mockSaveToken).toHaveBeenCalledWith('fresh-token', root);
173-
expect(mockOutro).toHaveBeenCalledWith('\n✓ Token saved. Unset `VOID_TOKEN` to use it.', {
174-
withGuide: false,
175-
});
174+
expect(mockOutro).toHaveBeenCalledWith(
175+
`\n${pc.green('✓ Token saved. Unset `VOID_TOKEN` to use it.')}`,
176+
{ withGuide: false },
177+
);
176178
});
177179
});

‎packages/void/test/unit/platform-plans-config.test.ts‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { join } from 'node:path';
44
import { createDefaultPlanCatalog, PLAN_LIMITS } from '@void/platform/plans';
55
import { confirm, outro, select, text } from '@voidzero-dev/vite-plus-prompts';
66
import { afterEach, beforeEach, describe, expect, it, vi } from 'vite-plus/test';
7+
import { pc } from '../../src/cli/output.ts';
78
import { parsePlatformArgs } from '../../src/cli/platform-args.ts';
89
import { parsePlatformPlansArgs } from '../../src/cli/platform-plans-args.ts';
910
import { runPlatformPlansConfig } from '../../src/cli/platform-plans-config.ts';
@@ -351,7 +352,7 @@ describe('platform config plans', () => {
351352
]);
352353
expect(console.log).not.toHaveBeenCalled();
353354
expect(outro).toHaveBeenCalledExactlyOnceWith(
354-
'\n✓ Saved plans.reset free. Account updates complete.',
355+
`\n${pc.green('✓ Saved plans.reset free. Account updates complete.')}`,
355356
{ withGuide: false },
356357
);
357358
});

0 commit comments

Comments
 (0)