hyperdx/packages/api/jest.setup.ts
Warren Lee 843c00cc17
fix: Adjust CI logs verbosity (#1888)
## Summary
- Silence noisy `console.debug` and `console.info` logs in test output across `api` and `common-utils` packages
- Add `DOTENV_CONFIG_OVERRIDE=true` to API integration test scripts so `.env.test` values take precedence
- Add shared jest setup for `common-utils` to suppress verbose console output during tests

Now the CI stdout should be much cleaner and readable (int tests especially)
2026-03-11 20:32:02 +00:00

22 lines
637 B
TypeScript

// @eslint-disable @typescript-eslint/no-var-requires
jest.retryTimes(1, { logErrorsBeforeRetry: true });
global.console = {
...console,
// Turn off noisy console logs in tests
debug: jest.fn(),
info: jest.fn(),
};
// Mock alert notification functions to prevent HTTP calls during tests
jest.mock('@/utils/slack', () => ({
...jest.requireActual('@/utils/slack'),
postMessageToWebhook: jest.fn().mockResolvedValue(null),
}));
// Mock global fetch for generic webhook calls
global.fetch = jest.fn().mockResolvedValue({
ok: true,
text: jest.fn().mockResolvedValue(''),
json: jest.fn().mockResolvedValue({}),
} as any);