-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathjest.setup.js
More file actions
32 lines (29 loc) · 856 Bytes
/
jest.setup.js
File metadata and controls
32 lines (29 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Mock terminal-size module to avoid ES module import issues
jest.mock('terminal-size', () => ({
default: jest.fn(() => ({ columns: 80, rows: 24 })),
}));
// Mock ansi-escapes module
jest.mock('ansi-escapes', () => ({
default: {
clearLines: jest.fn(() => ''),
cursorUp: jest.fn(() => ''),
cursorDown: jest.fn(() => ''),
eraseLines: jest.fn(() => ''),
},
}));
// Note: We intentionally allow console output in tests to verify logging behavior
// If you want to suppress console output, uncomment the lines below:
// const originalConsole = global.console;
// beforeEach(() => {
// global.console = {
// ...originalConsole,
// log: jest.fn(),
// info: jest.fn(),
// warn: jest.fn(),
// error: jest.fn(),
// debug: jest.fn(),
// };
// });
// afterEach(() => {
// global.console = originalConsole;
// });