dockest
Version:
Dockest is an integration testing tool aimed at alleviating the process of evaluating unit tests whilst running multi-container Docker applications.
51 lines • 1.99 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getOpts = void 0;
const events_1 = require("events");
const get_run_mode_1 = require("./get-run-mode");
const constants_1 = require("../constants");
const getOpts = (opts = {}) => {
const { composeFile = 'docker-compose.yml', composeOpts: { alwaysRecreateDeps = false, build = false, forceRecreate = false, noBuild = false, noColor = false, noDeps = false, noRecreate = false, quietPull = false, } = {}, debug = false || process.argv.includes('dev') || process.argv.includes('debug'), dumpErrors = false, exitHandler = async () => Promise.resolve(), jestLib = require('jest'), jestOpts, jestOpts: { projects = ['.'], runInBand: runInBandJest = true } = {}, logLevel = constants_1.LOG_LEVEL.INFO, runInBand = true, containerLogs: { serviceNameFilter = undefined, modes = ['aggregate'], logPath = './' } = {}, } = opts;
return {
composeFile,
composeOpts: {
alwaysRecreateDeps,
build,
forceRecreate,
noBuild,
noColor,
noDeps,
noRecreate,
quietPull,
},
debug,
dumpErrors,
exitHandler,
mutables: {
jestRanWithResult: false,
runners: {},
dockerEventEmitter: new events_1.EventEmitter(),
teardownOrder: null,
runnerLookupMap: new Map(),
},
hostname: process.env.HOSTNAME || constants_1.DEFAULT_HOST_NAME,
runMode: (0, get_run_mode_1.getRunMode)(),
jestLib,
jestOpts: {
projects,
runInBand: runInBandJest,
...jestOpts,
},
logLevel,
perfStart: Date.now(),
runInBand,
skipCheckConnection: false,
containerLogs: {
modes,
serviceNameFilter,
logPath,
},
};
};
exports.getOpts = getOpts;
//# sourceMappingURL=get-opts.js.map