dockest
Version:
Dockest is an integration testing tool aimed at alleviating the process of evaluating unit tests whilst running multi-container Docker applications.
22 lines • 998 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.execaWrapper = void 0;
const execa_1 = __importDefault(require("execa")); // eslint-disable-line import/default
const trim_1 = require("./trim");
const logger_1 = require("../logger");
const execaWrapper = (command, { runner, logPrefix = '[Shell]', logStdout = false, execaOpts = {} } = {}) => {
const trimmedCommand = (0, trim_1.trim)(command);
const logger = runner ? runner.logger : logger_1.Logger;
logger.debug(`${logPrefix} <${trimmedCommand}>`);
const result = execa_1.default.commandSync(trimmedCommand, {
shell: true,
...execaOpts,
});
logStdout && logger.debug(`${logPrefix} Success (${result.stdout})`, { success: true });
return result;
};
exports.execaWrapper = execaWrapper;
//# sourceMappingURL=execa-wrapper.js.map