UNPKG

mocha-chai-jest-snapshot

Version:
35 lines 1.17 kB
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.readJestConfig = exports.snapshotOptions = void 0; const node_path_1 = __importDefault(require("node:path")); const yargs_1 = __importDefault(require("yargs")); const ARGV_CI = !!process.env.CI; const ARGV_UPDATE_SNAPSHOT = !!process.env.UPDATE_SNAPSHOT || yargs_1.default .options({ update: { type: "boolean", default: false }, }) .parseSync().update; exports.snapshotOptions = { updateSnapshot: ARGV_CI && !ARGV_UPDATE_SNAPSHOT ? "none" : ARGV_UPDATE_SNAPSHOT ? "all" : "new", // unused prettierPath: "prettier", }; function readJestConfig(rootDir) { try { const jestConfig = require(node_path_1.default.join(rootDir, "./jest.config")); return typeof jestConfig === "function" ? jestConfig() : jestConfig; } catch (e) { return undefined; } } exports.readJestConfig = readJestConfig; //# sourceMappingURL=helper.js.map