diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/githubRepoPush.test.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/githubRepoPush.test.ts index 37a13bf814..8630dfab56 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/githubRepoPush.test.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/github/githubRepoPush.test.ts @@ -52,6 +52,10 @@ import { } from '../helpers'; import { createGithubRepoPushAction } from './githubRepoPush'; +const initRepoAndPushMocked = initRepoAndPush as jest.Mock< + Promise<{ commitHash: string }> +>; + const mockOctokit = { rest: { repos: { @@ -98,8 +102,7 @@ describe('github:repo:push', () => { beforeEach(() => { jest.resetAllMocks(); - // @ts-ignore TS2339 Jest Mock is not detected by Typescript - initRepoAndPush.mockResolvedValue({ commitHash: 'test123' }); + initRepoAndPushMocked.mockResolvedValue({ commitHash: 'test123' }); githubCredentialsProvider = DefaultGithubCredentialsProvider.fromIntegrations(integrations); diff --git a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.test.ts b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.test.ts index 206990536a..576a207786 100644 --- a/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.test.ts +++ b/plugins/scaffolder-backend/src/scaffolder/actions/builtin/publish/github.test.ts @@ -31,6 +31,10 @@ import { } from '../helpers'; import { createPublishGithubAction } from './github'; +const initRepoAndPushMocked = initRepoAndPush as jest.Mock< + Promise<{ commitHash: string }> +>; + const mockOctokit = { rest: { users: { @@ -87,8 +91,7 @@ describe('publish:github', () => { beforeEach(() => { jest.resetAllMocks(); - // @ts-ignore TS2339 Jest Mock is not detected by Typescript - initRepoAndPush.mockResolvedValue({ + initRepoAndPushMocked.mockResolvedValue({ commitHash: '220f19cc36b551763d157f1b5e4a4b446165dbd6', });