Skip to content

Commit 4d9c35b

Browse files
committed
cp dines
1 parent d1c6731 commit 4d9c35b

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

jest.components.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export default {
4343
"^figures$": "<rootDir>/tests/__mocks__/figures.ts",
4444
"^is-unicode-supported$": "<rootDir>/tests/__mocks__/is-unicode-supported.ts",
4545
"^conf$": "<rootDir>/tests/__mocks__/conf.ts",
46+
"^signal-exit$": "<rootDir>/tests/__mocks__/signal-exit.ts",
4647
},
4748

4849
// Transform configuration

tests/__mocks__/signal-exit.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/**
2+
* Mock for signal-exit module to avoid ESM teardown issues in Jest
3+
*/
4+
5+
const noop = () => () => {};
6+
7+
export default noop;
8+
export const onExit = noop;
9+

tests/setup-components.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ jest.mock("../src/utils/processUtils", () => ({
6262
installMockProcessUtils: jest.fn(),
6363
}));
6464

65+
// Mock signal-exit to avoid ESM teardown issues
66+
jest.mock("signal-exit", () => ({
67+
__esModule: true,
68+
default: jest.fn(() => () => {}),
69+
onExit: jest.fn(() => () => {}),
70+
}));
71+
6572
// Mock ESM-only dependencies that cause issues
6673
jest.mock("figures", () => ({
6774
__esModule: true,

0 commit comments

Comments
 (0)