"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getEndStatusFromJasmineJest = exports.getJasmineCurrentTest = void 0;
function getJasmineCurrentTest() {
    if (typeof jasmine === 'undefined') {
        throw new Error('global jasmine is missing');
    }
    if (typeof jasmine.currentTest === 'undefined') {
        throw new Error('global jasmine.currentTest is missing');
    }
    return jasmine.currentTest;
}
exports.getJasmineCurrentTest = getJasmineCurrentTest;
function getEndStatusFromJasmineJest() {
    const t = getJasmineCurrentTest();
    const testEndStatus = t.failedExpectations.length > 0 ?
        {
            success: false,
            error: t.failedExpectations[0],
        } :
        {
            success: true,
            data: t.passedExpectations,
        };
    return testEndStatus;
}
exports.getEndStatusFromJasmineJest = getEndStatusFromJasmineJest;
