@assurka/jest
Version:
Assurka Jest Plugin
44 lines • 1.67 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var prompts_1 = __importDefault(require("prompts"));
var AssurkaCustomWatcher = /** @class */ (function () {
function AssurkaCustomWatcher(_a) {
var stdin = _a.stdin, stdout = _a.stdout, _b = _a.config, config = _b === void 0 ? {} : _b;
this._stdin = stdin;
this._stdout = stdout;
}
// Add hooks to Jest lifecycle events
AssurkaCustomWatcher.prototype.apply = function (jestHooks) { };
// Get the prompt information for interactive plugins
AssurkaCustomWatcher.prototype.getUsageInfo = function (globalConfig) {
return {
key: 's',
prompt: 'run assurka studio'
};
};
// Executed when the key from `getUsageInfo` is input
AssurkaCustomWatcher.prototype.run = function (globalConfig, updateConfigAndRun) {
return prompts_1.default([
{
type: 'text',
name: 'testPlanId',
message: 'Enter test plan id'
}
]).then(function (_a) {
var testPlanId = _a.testPlanId;
process.stdin.setRawMode(true);
process.stdin.resume();
if (testPlanId !== undefined) {
process.env.__ASSURKA_TESTPLAN_ID__ = testPlanId;
return true;
}
return Promise.reject();
});
};
return AssurkaCustomWatcher;
}());
exports.default = AssurkaCustomWatcher;
//# sourceMappingURL=watcher.js.map