UNPKG

@serenity-js/core

Version:

The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure

26 lines 1.02 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.AssertionError = void 0; const ErrorSerialiser_1 = require("../ErrorSerialiser"); const RuntimeError_1 = require("./RuntimeError"); /** * Thrown to indicate that an assertion has failed. * * @group Errors */ class AssertionError extends RuntimeError_1.RuntimeError { static fromJSON(serialised) { const error = new AssertionError(serialised.message, ErrorSerialiser_1.ErrorSerialiser.deserialise(serialised.cause)); error.stack = serialised.stack; return error; } /** * @param message - Human-readable description of the error and the difference between the expected and actual values * @param [cause] - The root cause of this [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/), if any */ constructor(message, cause) { super(AssertionError, message, cause); } } exports.AssertionError = AssertionError; //# sourceMappingURL=AssertionError.js.map