UNPKG

jest-allure2-adapter

Version:
31 lines (30 loc) 1.1 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CustomReporterCirc = void 0; class CustomReporterCirc { constructor(options) { this.options = options; // Constructor logic, if any console.log('CustomReporter initialized with options:', options); } onRunStart(_aggregatedResults, _options) { // Called when the test run starts console.log('Test run started'); } onTestResult(_test, _testResult, _aggregatedResults) { // Called for each test result // You can access the individual test and its result here console.log(`TEST RES:${_test.path}`); } onRunComplete(testContexts, results) { console.log(`Test run completed ${JSON.stringify(results)}`); } // Optionally, reporters can force Jest to exit with non zero code by returning // an `Error` from `getLastError()` method. getLastError() { //if (this._shouldFail) { return new Error('Custom error reported!'); //} } } exports.CustomReporterCirc = CustomReporterCirc;