Skip to content

Commit 57d06c0

Browse files
committed
fix(test): update ansi tests to import from dist/ instead of src/
Tests now import from dist/ to catch bundling compatibility issues. The original bug (stripAnsi22 is not a function) only appeared in bundled code due to ESM/CJS interop issues between strip-ansi@6.0.1 and ansi-regex@6.2.2. Testing the bundled output ensures we catch these issues before they reach production.
1 parent 78411bd commit 57d06c0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/unit/ansi.test.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
/**
22
* @fileoverview Tests for ANSI escape code utilities.
3+
*
4+
* IMPORTANT: This test imports from dist/ to catch bundling compatibility issues.
5+
* The original bug occurred when strip-ansi@6.0.1 was bundled with ansi-regex@6.2.2,
6+
* causing "stripAnsi22 is not a function" errors. Testing the bundled dist/ ensures
7+
* we catch ESM/CJS interop issues that only appear after bundling.
38
*/
49

510
import { describe, expect, it } from 'vitest'
@@ -13,7 +18,7 @@ import {
1318
ANSI_UNDERLINE,
1419
ansiRegex,
1520
stripAnsi,
16-
} from '../../src/ansi.js'
21+
} from '../../dist/ansi.js'
1722

1823
describe('ansi', () => {
1924
describe('constants', () => {

0 commit comments

Comments
 (0)