Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
beforeEach(function () {
// Intercept all real stdin/stdout.
runStub = base.sandbox.stub(Prompt.prototype, "run");
});
cyan: {
get() {
return chalk.bold;
},
},
bold: {
get() {
return chalk.bold.yellow;
},
},
});
// 'Serverless:' prefix
const BasePrompt = require('inquirer/lib/prompts/base');
const originalGetQuestion = BasePrompt.prototype.getQuestion;
BasePrompt.prototype.getQuestion = function() {
this.opt.prefix = 'Serverless:';
return originalGetQuestion.call(this);
};
return require('inquirer');
});
Object.defineProperties(require(inquirersChalkPath), {
cyan: {
get() {
return chalk.bold;
},
},
bold: {
get() {
return chalk.bold.yellow;
},
},
});
// 'Serverless:' prefix
const BasePrompt = require('inquirer/lib/prompts/base');
const originalGetQuestion = BasePrompt.prototype.getQuestion;
BasePrompt.prototype.getQuestion = function() {
this.opt.prefix = 'Serverless:';
return originalGetQuestion.call(this);
};
return require('inquirer');
});