UNPKG

@serenity-js/core

Version:

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

65 lines 2.63 kB
"use strict"; var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.Unanswered = void 0; const tiny_types_1 = require("tiny-types"); const util = __importStar(require("util")); // eslint-disable-line unicorn/import-style /** * A placeholder value signifying that a [`Question`](https://serenity-js.org/api/core/class/Question/) * has not been answered by an [`Actor`](https://serenity-js.org/api/core/class/Actor/) when producing an [`ExpectationOutcome`](https://serenity-js.org/api/core/class/ExpectationOutcome/). * This happens when Serenity/JS decides that answering a given question * won't affect the outcome. * * For example, making the actor answer questions about the expected value * and the actual value of each list item is unnecessary if we already know that the list itself is empty. * * @group Questions */ class Unanswered extends tiny_types_1.TinyType { static isUnanswered(value) { return value instanceof Unanswered; } [util.inspect.custom]() { return `<<unanswered>>`; } toString() { return 'unanswered'; } toJSON() { return undefined; // eslint-disable-line unicorn/no-useless-undefined } } exports.Unanswered = Unanswered; //# sourceMappingURL=Unanswered.js.map