Add tests for errors when fetching actions
This commit is contained in:
@@ -110,4 +110,23 @@ describe("action descriptions", () => {
|
|||||||
|
|
||||||
expect(await getDescription("typo", mock)).toBeUndefined();
|
expect(await getDescription("typo", mock)).toBeUndefined();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// TODO: https://github.com/github/c2c-actions-experience/issues/7056
|
||||||
|
it.failing("action does not exist", async () => {
|
||||||
|
const mock = fetchMock
|
||||||
|
.sandbox()
|
||||||
|
.getOnce("https://api.github.com/repos/actions/checkout/contents/action.yml?ref=v3", 404)
|
||||||
|
.getOnce("https://api.github.com/repos/actions/checkout/contents/action.yaml?ref=v3", 404);
|
||||||
|
|
||||||
|
expect(await getDescription("repository", mock)).toBeUndefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
// TODO: https://github.com/github/c2c-actions-experience/issues/7056
|
||||||
|
it.failing("invalid permissions", async () => {
|
||||||
|
const mock = fetchMock
|
||||||
|
.sandbox()
|
||||||
|
.getOnce("https://api.github.com/repos/actions/checkout/contents/action.yml?ref=v3", 403);
|
||||||
|
|
||||||
|
expect(await getDescription("repository", mock)).toBeUndefined();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user