-
Notifications
You must be signed in to change notification settings - Fork 87
Expand file tree
/
Copy pathsetup.ts
More file actions
33 lines (28 loc) · 748 Bytes
/
setup.ts
File metadata and controls
33 lines (28 loc) · 748 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
33
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
// Test setup file for Jest
// This file runs before all tests
import { afterAll, jest } from '@jest/globals';
// Mock console methods to reduce noise in test output
global.console = {
...console,
// Keep errors and warnings
error: jest.fn(console.error),
warn: jest.fn(console.warn),
// Silence other logs during tests unless explicitly needed
log: jest.fn(),
info: jest.fn(),
debug: jest.fn(),
};
// Set test environment variables
process.env.NODE_ENV = 'test';
// Increase timeout for integration tests if needed
jest.setTimeout(10000);
// Clean up after all tests
afterAll(() => {
jest.clearAllMocks();
jest.restoreAllMocks();
});