Skip to content

Commit 6369be6

Browse files
committed
apply code review
1 parent 79ac735 commit 6369be6

File tree

1 file changed

+6
-15
lines changed

1 file changed

+6
-15
lines changed

lib/modules/manager/gomod/artifacts.spec.ts

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2134,13 +2134,7 @@ describe('modules/manager/gomod/artifacts', () => {
21342134
fs.readLocalFile
21352135
.mockResolvedValueOnce('New go.sum')
21362136
.mockResolvedValueOnce('New go.mod');
2137-
datasource.getPkgReleases.mockResolvedValueOnce({
2138-
releases: [
2139-
{ version: '1.17.0' },
2140-
{ version: '1.23.6' },
2141-
{ version: '1.24.0' },
2142-
],
2143-
});
2137+
21442138
const res = await gomod.updateArtifacts({
21452139
packageFileName: 'go.mod',
21462140
updatedDeps: [{ depName: 'golang.org/x/crypto', newVersion: '0.35.0' }],
@@ -2164,6 +2158,8 @@ describe('modules/manager/gomod/artifacts', () => {
21642158
cmd: 'go get -d -t ./...',
21652159
},
21662160
]);
2161+
2162+
expect(datasource.getPkgReleases).toBeCalledTimes(0);
21672163
});
21682164

21692165
it('go.mod file contains full go version without toolchain', async () => {
@@ -2179,14 +2175,7 @@ describe('modules/manager/gomod/artifacts', () => {
21792175
fs.readLocalFile
21802176
.mockResolvedValueOnce('New go.sum')
21812177
.mockResolvedValueOnce('New go.mod');
2182-
datasource.getPkgReleases.mockResolvedValueOnce({
2183-
releases: [
2184-
{ version: '1.17.0' },
2185-
{ version: '1.23.5' },
2186-
{ version: '1.23.6' },
2187-
{ version: '1.24.0' },
2188-
],
2189-
});
2178+
21902179
const res = await gomod.updateArtifacts({
21912180
packageFileName: 'go.mod',
21922181
updatedDeps: [{ depName: 'golang.org/x/crypto', newVersion: '0.35.0' }],
@@ -2209,6 +2198,8 @@ describe('modules/manager/gomod/artifacts', () => {
22092198
cmd: 'go get -d -t ./...',
22102199
},
22112200
]);
2201+
2202+
expect(datasource.getPkgReleases).toBeCalledTimes(0);
22122203
});
22132204

22142205
it('returns artifact notices', async () => {

0 commit comments

Comments
 (0)