Skip to content

Commit 444c000

Browse files
committed
fix(tests): fix GitLab provider mock constructor
- Change Gitlab mock from arrow function to regular function - Ensure mock can be called with 'new' operator This fixes 2 more failing tests with same arrow function issue.
1 parent 5316643 commit 444c000

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

packages/cli/src/utils/git/providers.test.mts

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,19 @@ vi.mock('./operations.mts', () => ({
2424
}))
2525

2626
vi.mock('@gitbeaker/rest', () => ({
27-
Gitlab: vi.fn().mockImplementation(() => ({
28-
MergeRequests: {
29-
create: vi.fn(),
30-
show: vi.fn(),
31-
rebase: vi.fn(),
32-
all: vi.fn(),
33-
},
34-
MergeRequestNotes: {
35-
create: vi.fn(),
36-
},
37-
})),
27+
Gitlab: vi.fn().mockImplementation(function () {
28+
return {
29+
MergeRequests: {
30+
create: vi.fn(),
31+
show: vi.fn(),
32+
rebase: vi.fn(),
33+
all: vi.fn(),
34+
},
35+
MergeRequestNotes: {
36+
create: vi.fn(),
37+
},
38+
}
39+
}),
3840
}))
3941

4042
describe('provider-factory', () => {

0 commit comments

Comments
 (0)