Skip to content

Commit

Permalink
JST-112: Fixed skip unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
mgordel committed Aug 4, 2023
1 parent 5487c7b commit c50fc29
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/unit/work.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ describe("Work Context", () => {
});
});
describe("Error handling", () => {
it.skip("should catch error while executing batch as promise with invalid command", async () => {
it("should catch error while executing batch as promise with invalid command", async () => {
const activity = await Activity.create("test_agreement_id");
const worker: Worker<null, Result[]> = async (ctx) => ctx.beginBatch().run("invalid_shell_command").end();
const ctx = new WorkContext(activity, {
Expand All @@ -152,7 +152,13 @@ describe("Work Context", () => {
});
const expectedStdout = [{ result: "Error", stderr: "error", message: "Some error occurred" }];
activityMock.setExpectedExeResults(expectedStdout);
await expect(worker(ctx)).rejects.toThrow(expectedStdout[0].message);
let expectedError;
try {
await worker(ctx);
} catch (err) {
expectedError = err;
}
expect(expectedError).toEqual(`Error: ${expectedStdout[0].message}`);
});

it("should catch error while executing batch as stream with invalid command", async () => {
Expand Down

0 comments on commit c50fc29

Please sign in to comment.