mirror of
https://github.com/renovatebot/renovate.git
synced 2026-10-25 15:01:49 +00:00
930cf6633c
fix: Additional vi.mock path corrections and prettier formatting
39 lines
1.1 KiB
TypeScript
39 lines
1.1 KiB
TypeScript
// Check for missing or pending http mocks
|
|
import './http-mock.ts';
|
|
import { mockDeep } from 'vitest-mock-extended';
|
|
import type { Platform, PlatformScm } from '../lib/modules/platform/index.ts';
|
|
import * as _fixtures from './fixtures.ts';
|
|
|
|
// Set timezone so snapshots are consistent
|
|
process.env.TZ = 'UTC';
|
|
|
|
vi.mock('../lib/modules/platform/index.ts', () => ({
|
|
platform: mockDeep<Platform>(),
|
|
initPlatform: vi.fn(),
|
|
getPlatformList: vi.fn(),
|
|
}));
|
|
|
|
vi.mock('../lib/modules/platform/scm.ts', () => ({
|
|
scm: mockDeep<PlatformScm>(),
|
|
}));
|
|
|
|
vi.mock('../lib/logger/index.ts', () => {
|
|
return mockDeep({
|
|
withMeta: <T>(_: Record<string, unknown>, cb: () => T): T => cb(),
|
|
});
|
|
});
|
|
|
|
vi.mock('../lib/util/git/index.ts', () => mockDeep());
|
|
|
|
vi.mock('../lib/util/exec/common.ts', () => ({ rawExec: vi.fn() }));
|
|
|
|
Object.defineProperty(global, 'fixtures', { value: _fixtures });
|
|
declare global {
|
|
const fixtures: typeof _fixtures;
|
|
}
|
|
|
|
vi.mock('../lib/util/mutex.ts', () => ({
|
|
initMutexes: () => vi.fn(),
|
|
acquireLock: () => vi.fn().mockImplementation(() => () => undefined),
|
|
}));
|