Skip to content

Commit

Permalink
Merge pull request #754 from gemini-testing/HERMIONE-954.fix_hermione…
Browse files Browse the repository at this point in the history
…_halt

fix: show error with stack trace on call hermione.halt method
  • Loading branch information
DudaGod committed Apr 3, 2023
2 parents b5941d6 + 61cfc26 commit 67e630e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/hermione.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ module.exports = class Hermione extends BaseHermione {
}

halt(err, timeout = 60000) {
logger.error(`Terminating on critical error: ${err}`);
logger.error("Terminating on critical error:", err);

this._fail();

Expand Down
6 changes: 4 additions & 2 deletions test/src/hermione.js
Original file line number Diff line number Diff line change
Expand Up @@ -728,12 +728,14 @@ describe("hermione", () => {
});

it("should log provided error", () => {
const err = new Error("test error");

hermione.on(RunnerEvents.RUNNER_START, () => {
hermione.halt(new Error("test error"));
hermione.halt(err);
});

return hermione.run().finally(() => {
assert.calledOnceWith(logger.error, sinon.match(/Error: test error/));
assert.calledOnceWith(logger.error, "Terminating on critical error:", err);
});
});

Expand Down

0 comments on commit 67e630e

Please sign in to comment.