a2r
Version:
A2R Framework
23 lines (22 loc) • 668 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.isJest = exports.setForceDisableJestDetection = void 0;
let forceDisableJestDetection = false;
/**
* Allows you to disable Jest detection
* @param {boolean} value True to disable Jest detection
*/
const setForceDisableJestDetection = (value) => {
forceDisableJestDetection = value;
};
exports.setForceDisableJestDetection = setForceDisableJestDetection;
/**
* Checks if the script is running using Jest test engine
*/
const isJest = () => {
if (forceDisableJestDetection) {
return false;
}
return typeof jest !== 'undefined';
};
exports.isJest = isJest;