Add mock fix
Signed-off-by: Lukas Fruntke (external expert on behalf of DB Netz) <lukas.fruntke-extern@deutschebahn.com>
This commit is contained in:
parent
0e3f44132a
commit
c92153205f
+5
-2
@@ -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);
|
||||
|
||||
@@ -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',
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user