@@ -48,7 +48,7 @@ const mockGitlabClient = {
|
||||
}),
|
||||
},
|
||||
Commits: {
|
||||
create: jest.fn(),
|
||||
create: jest.fn(() => ({ id: 'mockId' })),
|
||||
},
|
||||
MergeRequests: {
|
||||
create: jest.fn(async (repoId: string) => {
|
||||
@@ -267,7 +267,10 @@ describe('createGitLabMergeRequest', () => {
|
||||
irrelevant: { 'bar.txt': 'Nothing to see here' },
|
||||
},
|
||||
});
|
||||
const ctx = createMockActionContext({ input, workspacePath });
|
||||
const ctx = createMockActionContext({
|
||||
input,
|
||||
workspacePath,
|
||||
});
|
||||
await instance.handler(ctx);
|
||||
|
||||
expect(mockGitlabClient.Projects.show).not.toHaveBeenCalled();
|
||||
|
||||
@@ -21,7 +21,7 @@ import {
|
||||
mockCredentials,
|
||||
mockServices,
|
||||
} from '@backstage/backend-test-utils';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
import { JsonObject, JsonValue } from '@backstage/types';
|
||||
import { ActionContext } from '@backstage/plugin-scaffolder-node';
|
||||
|
||||
/**
|
||||
@@ -43,7 +43,12 @@ export const createMockActionContext = <
|
||||
output: jest.fn(),
|
||||
createTemporaryDirectory: jest.fn(),
|
||||
input: {} as TActionInput,
|
||||
checkpoint: jest.fn(),
|
||||
async checkpoint<T extends JsonValue | void>(opts: {
|
||||
key: string;
|
||||
fn: () => Promise<T> | T;
|
||||
}): Promise<T> {
|
||||
return opts.fn();
|
||||
},
|
||||
getInitiatorCredentials: () => Promise.resolve(credentials),
|
||||
task: {
|
||||
id: 'mock-task-id',
|
||||
|
||||
Reference in New Issue
Block a user