mirror of
https://code.forgejo.org/actions/cache.git
synced 2025-04-21 16:23:56 +08:00
PR Feedback
This commit is contained in:
parent
bae12fc444
commit
ead4a0a409
3 changed files with 13 additions and 4 deletions
|
@ -33,6 +33,11 @@ beforeAll(() => {
|
|||
return actualUtils.isValidEvent();
|
||||
});
|
||||
|
||||
jest.spyOn(actionUtils, "getSupportedEvents", ).mockImplementation(() => {
|
||||
const actualUtils = jest.requireActual("../src/utils/actionUtils");
|
||||
return actualUtils.getSupportedEvents();
|
||||
});
|
||||
|
||||
jest.spyOn(io, "which").mockImplementation(tool => {
|
||||
return Promise.resolve(tool);
|
||||
});
|
||||
|
@ -53,7 +58,7 @@ test("restore with invalid event", async () => {
|
|||
process.env[Events.Key] = invalidEvent;
|
||||
await run();
|
||||
expect(failedMock).toHaveBeenCalledWith(
|
||||
`Event Validation Error: The event type ${invalidEvent} is not supported. Only \`push\` and \`pull_request\` events are supported at this time.`
|
||||
`Event Validation Error: The event type ${invalidEvent} is not supported. Only push, pull_request events are supported at this time.`
|
||||
);
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue