Skip to content

Commit d8d4299

Browse files
fix: type-check
1 parent b56d0d8 commit d8d4299

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

lib/modules/platform/azure/issue.spec.ts

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,33 @@
11
import { vi } from 'vitest';
22
import { mockDeep } from 'vitest-mock-extended';
3-
import { logger } from '../../../logger/index.ts';
4-
import * as hostRules from '../../../util/host-rules.ts';
5-
import * as azureApi from './azure-got-wrapper.ts';
3+
import { logger as _logger } from '~test/util.ts';
4+
import * as _hostRules from '../../../util/host-rules.ts';
5+
import * as _azureApi from './azure-got-wrapper.ts';
66
import { IssueService } from './issue.ts';
77
import type { Config } from './types.ts';
88

9+
const logger = _logger.logger;
10+
911
vi.mock('./azure-got-wrapper.ts', () => mockDeep());
1012
vi.mock('./azure-helper.ts', () => mockDeep());
1113
vi.mock('../../../util/host-rules.ts', () => mockDeep());
12-
vi.mock('../../../logger/index.ts', () => mockDeep());
1314
vi.mock('../../../util/sanitize.ts', () =>
1415
mockDeep({ sanitize: (s: string) => s }),
1516
);
1617
vi.mock('./util.ts', () => ({
1718
getWorkItemTitle: vi.fn((title: string) => `[Renovate] ${title}`),
1819
}));
1920

21+
const azureApi = vi.mocked(_azureApi, true);
22+
const hostRules = vi.mocked(_hostRules);
23+
2024
describe('modules/platform/azure/issue', () => {
2125
let config: Config;
2226
let issueService: IssueService;
2327

2428
beforeEach(() => {
2529
vi.clearAllMocks();
26-
vi.mocked(hostRules.find).mockReturnValue({ token: 'token' });
30+
hostRules.find.mockReturnValue({ token: 'token' });
2731

2832
config = {
2933
repository: 'test/repo',

0 commit comments

Comments
 (0)