Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 21 additions & 32 deletions lib/modules/datasource/pypi/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { GoogleAuth as _googleAuth } from 'google-auth-library';
import { Fixtures } from '~test/fixtures.ts';
import * as httpMock from '~test/http-mock.ts';
import { partial } from '~test/util.ts';
import * as hostRules from '../../../util/host-rules.ts';
import { getPkgReleases } from '../index.ts';
import { PypiDatasource } from './index.ts';
Expand Down Expand Up @@ -204,14 +205,11 @@ describe('modules/datasource/pypi/index', () => {
'https://someregion-python.pkg.dev/some-project/some-repo',
],
};
googleAuth.mockImplementationOnce(
// TODO: fix typing
vi.fn<any>(
class {
getAccessToken = vi.fn().mockResolvedValue('some-token');
},
),
);
googleAuth.mockImplementationOnce(function () {
return partial<InstanceType<typeof _googleAuth>>({
getAccessToken: vi.fn().mockResolvedValue('some-token'),
});
});
const res = await getPkgReleases({
...config,
datasource,
Expand All @@ -231,14 +229,11 @@ describe('modules/datasource/pypi/index', () => {
'https://someregion-python.pkg.dev/some-project/some-repo',
],
};
googleAuth.mockImplementation(
// TODO: fix typing
vi.fn<any>(
class {
getAccessToken = vi.fn();
},
),
);
googleAuth.mockImplementation(function () {
return partial<InstanceType<typeof _googleAuth>>({
getAccessToken: vi.fn(),
});
});
const res = await getPkgReleases({
...config,
datasource,
Expand Down Expand Up @@ -803,14 +798,11 @@ describe('modules/datasource/pypi/index', () => {
'https://someregion-python.pkg.dev/some-project/some-repo/simple/',
],
};
googleAuth.mockImplementationOnce(
// TODO: fix typing
vi.fn<any>(
class {
getAccessToken = vi.fn().mockResolvedValue('some-token');
},
),
);
googleAuth.mockImplementationOnce(function () {
return partial<InstanceType<typeof _googleAuth>>({
getAccessToken: vi.fn().mockResolvedValue('some-token'),
});
});
expect(
await getPkgReleases({
datasource,
Expand All @@ -837,14 +829,11 @@ describe('modules/datasource/pypi/index', () => {
'https://oauth2accesstoken@someregion-python.pkg.dev/some-project/some-repo/simple/',
],
};
googleAuth.mockImplementationOnce(
// TODO: fix typing
vi.fn<any>(
class {
getAccessToken = vi.fn().mockResolvedValue('some-token');
},
),
);
googleAuth.mockImplementationOnce(function () {
return partial<InstanceType<typeof _googleAuth>>({
getAccessToken: vi.fn().mockResolvedValue('some-token'),
});
});
expect(
await getPkgReleases({
datasource,
Expand Down
Loading