Skip to content

Commit 4f4d8cb

Browse files
committed
test(cli): account for colored error output
1 parent a28690d commit 4f4d8cb

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

packages/cli/test/nodes.test.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import type { RootNode } from '@codama/nodes';
2+
import pico from 'picocolors';
23
import { beforeEach, describe, expect, test, vi } from 'vitest';
34

45
import { CliError } from '../src/utils/errors';
@@ -42,9 +43,11 @@ describe('getRootNodeFromIdl', () => {
4243
expect(error).toBeInstanceOf(CliError);
4344
expect((error as CliError).message).toBe('Anchor IDL support is not available.');
4445
expect((error as CliError).items).toEqual([
45-
'Missing dependency: @codama/nodes-from-anchor',
46+
`${pico.bold('Missing dependency')}: @codama/nodes-from-anchor`,
4647
'No package.json was found, so Codama did not install dependencies in this directory.',
47-
'Re-run with: npx -p codama -p @codama/nodes-from-anchor codama convert anchor.json codama.json',
48+
`${pico.bold('Re-run with')}: ${pico.yellow(
49+
'npx -p codama -p @codama/nodes-from-anchor codama convert anchor.json codama.json',
50+
)}`,
4851
]);
4952
expect(installMissingDependenciesMock).not.toHaveBeenCalled();
5053
});

0 commit comments

Comments
 (0)