@serenity-js/core
Version:
The core Serenity/JS framework, providing the Screenplay Pattern interfaces, as well as the test reporting and integration infrastructure
47 lines • 1.8 kB
JavaScript
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImplementationPendingError = void 0;
const ErrorSerialiser_1 = require("../ErrorSerialiser");
const RuntimeError_1 = require("./RuntimeError");
/**
* Thrown to indicate that the [`Actor`](https://serenity-js.org/api/core/class/Actor/) attempted to perform
* a [`Task`](https://serenity-js.org/api/core/class/Task/) or [`Interaction`](https://serenity-js.org/api/core/class/Interaction/) that hasn't been implemented yet.
*
* ## A pending Task
*
* ```ts
* import { Task } from '@serenity-js/core'
*
* // A pending Task is one that encapsulates no other activities
* const Authenticate = () =>
* Task.where(`#actor authenticates with the service up a test database` )
* ```
*
* ## A pending Interaction
*
* ```ts
* import { Interaction } from '@serenity-js/core'
*
* // A pending Interaction is one that doesn't perform any action
* const DoubleClick = () =>
* Interaction.where(`#actor double-clicks`)
* ```
*
* @group Errors
*/
class ImplementationPendingError extends RuntimeError_1.RuntimeError {
static fromJSON(serialised) {
const error = new ImplementationPendingError(serialised.message, ErrorSerialiser_1.ErrorSerialiser.deserialise(serialised.cause));
error.stack = serialised.stack;
return error;
}
/**
* @param {string} message - Human-readable description of the error
* @param {Error} [cause] - The root cause of this [`RuntimeError`](https://serenity-js.org/api/core/class/RuntimeError/), if any
*/
constructor(message, cause) {
super(ImplementationPendingError, message, cause);
}
}
exports.ImplementationPendingError = ImplementationPendingError;
//# sourceMappingURL=ImplementationPendingError.js.map
;