|
1 | 1 | import { vi } from 'vitest'; |
2 | 2 | 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'; |
6 | 6 | import { IssueService } from './issue.ts'; |
7 | 7 | import type { Config } from './types.ts'; |
8 | 8 |
|
| 9 | +const logger = _logger.logger; |
| 10 | + |
9 | 11 | vi.mock('./azure-got-wrapper.ts', () => mockDeep()); |
10 | 12 | vi.mock('./azure-helper.ts', () => mockDeep()); |
11 | 13 | vi.mock('../../../util/host-rules.ts', () => mockDeep()); |
12 | | -vi.mock('../../../logger/index.ts', () => mockDeep()); |
13 | 14 | vi.mock('../../../util/sanitize.ts', () => |
14 | 15 | mockDeep({ sanitize: (s: string) => s }), |
15 | 16 | ); |
16 | 17 | vi.mock('./util.ts', () => ({ |
17 | 18 | getWorkItemTitle: vi.fn((title: string) => `[Renovate] ${title}`), |
18 | 19 | })); |
19 | 20 |
|
| 21 | +const azureApi = vi.mocked(_azureApi, true); |
| 22 | +const hostRules = vi.mocked(_hostRules); |
| 23 | + |
20 | 24 | describe('modules/platform/azure/issue', () => { |
21 | 25 | let config: Config; |
22 | 26 | let issueService: IssueService; |
23 | 27 |
|
24 | 28 | beforeEach(() => { |
25 | 29 | vi.clearAllMocks(); |
26 | | - vi.mocked(hostRules.find).mockReturnValue({ token: 'token' }); |
| 30 | + hostRules.find.mockReturnValue({ token: 'token' }); |
27 | 31 |
|
28 | 32 | config = { |
29 | 33 | repository: 'test/repo', |
|
0 commit comments