0
0
Fork 0
mirror of https://github.com/renovatebot/renovate.git synced 2025-03-15 08:34:54 +00:00
renovatebot_renovate/test/setup.ts
2025-03-13 17:52:09 +00:00

33 lines
887 B
TypeScript

// Check for missing or pending http mocks
import './http-mock';
import { mockDeep } from 'vitest-mock-extended';
import type { Platform, PlatformScm } from '../lib/modules/platform';
import * as _fixtures from './fixtures';
// Set timezone so snapshots are consistent
process.env.TZ = 'UTC';
vi.mock('../lib/modules/platform', () => ({
platform: mockDeep<Platform>(),
initPlatform: vi.fn(),
getPlatformList: vi.fn(),
}));
vi.mock('../lib/modules/platform/scm', () => ({
scm: mockDeep<PlatformScm>(),
}));
vi.mock('../lib/logger', () => {
return mockDeep({
withMeta: <T>(_: Record<string, unknown>, cb: () => T): T => cb(),
});
});
vi.mock('../lib/util/git', () => mockDeep());
vi.mock('../lib/util/exec/common', () => ({ rawExec: vi.fn() }));
Object.defineProperty(global, 'fixtures', { value: _fixtures });
declare global {
const fixtures: typeof _fixtures;
}