UNPKG

@serenity-js/jasmine

Version:

Serenity/JS test runner adapter for Jasmine, enabling the use of the Screenplay Pattern in Jasmine-based test suites and leveraging Serenity/JS reporting capabilities

92 lines 3.17 kB
import { type Serenity } from '@serenity-js/core'; import type { RequirementsHierarchy } from '@serenity-js/core/io'; import type { JasmineDoneInfo, JasmineReporter, JasmineStartedInfo, SpecResult, SuiteResult } from './jasmine/index.js'; /** * [Jasmine reporter](https://jasmine.github.io/tutorials/custom_reporter) that translates Jasmine-specific test events * to Serenity/JS events. */ export declare class SerenityReporterForJasmine implements JasmineReporter { private readonly serenity; private readonly requirementsHierachy; private static readonly errorMessagePattern; private describes; private currentSceneId; /** * @param serenity - The Serenity instance * @param requirementsHierarchy - The requirements hierarchy for tagging */ constructor(serenity: Serenity, requirementsHierachy: RequirementsHierarchy); jasmineStarted(info: JasmineStartedInfo): void; suiteStarted(result: SuiteResult): void; suiteDone(result: SuiteResult): void; specStarted(result: SpecResult): void; specDone(result: SpecResult): Promise<void>; jasmineDone(suiteInfo: JasmineDoneInfo): Promise<void>; /** * @private * @param {DomainEvent[]} events */ private emit; /** * Extracts location information from a spec or suite result. * Supports both Jasmine 5.x and 6.x (location object from monkey-patching). * * @private * @param result - The spec or suite result * @returns Location object with path, line, and column */ private locationOf; /** * @private * @param {SpecResult} spec * @returns {ScenarioDetails} */ private scenarioDetailsOf; /** * @private * @param {SuiteResult} result * @returns {TestSuiteDetails} */ private testSuiteDetailsOf; /** * @private * @returns {string} */ private currentFeatureNameFor; /** * @private * @param {string} itBlockDescription * @returns {string} */ private currentScenarioNameFor; /** * @private * @param {SpecResult | SuiteResult} result * @returns {Outcome} */ private outcomeFrom; /** * @private * @param {Expectation} failure * @returns {ProblemIndication} */ private failureOutcomeFrom; private errorFrom; private containsCorrectlySerialisedError; private containsIncorrectlySerialisedErrorWithErrorPropertiesInStack; private containsIncorrectlySerialisedError; /** * It seems like Jasmine mixes up serialisation and display logic, * which means that its "failure.stack" is not really an Error stacktrace, * but rather something along the lines of: * "error properties: AssertionError: undefined" * where the error message is lost, and there's an "error properties:" prefix present. * * Probably caused by this: * https://github.com/jasmine/jasmine/blob/b4cbe9850fbe192eaffeae450669f96e79a574ed/src/core/ExceptionFormatter.js#L93 * * @param {Expectation} failure */ private repairedStackTraceOf; } //# sourceMappingURL=SerenityReporterForJasmine.d.ts.map