Skip to content

Commit ad7463a

Browse files
committed
test: update test assertions
1 parent 7a798ab commit ad7463a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/api.spec.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ describe("API", () => {
145145
`);
146146
});
147147

148-
it("should throw if a non-204 status is returned", async () => {
148+
it("should throw if a non-200 or non-204 status is returned", async () => {
149149
const errorStatus = 401;
150150
vi.spyOn(
151151
mockOctokit.rest.actions,
@@ -160,14 +160,14 @@ describe("API", () => {
160160

161161
// Behaviour
162162
await expect(dispatchWorkflow("")).rejects.toThrow(
163-
`Failed to dispatch action, expected 204 but received ${errorStatus}`,
163+
`Failed to dispatch action, expected 200 or 204 but received ${errorStatus}`,
164164
);
165165

166166
// Logging
167167
assertOnlyCalled(coreErrorLogMock, coreDebugLogMock);
168168
expect(coreErrorLogMock).toHaveBeenCalledOnce();
169169
expect(coreErrorLogMock.mock.calls[0]?.[0]).toMatchInlineSnapshot(
170-
`"dispatchWorkflow: An unexpected error has occurred: Failed to dispatch action, expected 204 but received 401"`,
170+
`"dispatchWorkflow: An unexpected error has occurred: Failed to dispatch action, expected 200 or 204 but received 401"`,
171171
);
172172
expect(coreDebugLogMock).toHaveBeenCalledOnce();
173173
});

0 commit comments

Comments
 (0)