Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const setupTest = () => {
const command = new BaseCommand();
return test
.stub(command, 'parse', sandbox.stub().returns({ flags: defaultFlags }))
.stub(command, 'error', sandbox.stub())
.stub(print, 'default', sandbox.stub().returns(printMethodStub))
.stub(config, 'getConfig', sandbox.stub().returns(defaultConfig))
.add('command', () => command);
};
.stub(
utils,
'passwordPrompt',
async (): Promise => {
return Promise.resolve('Ethereum');
},
)
.stdout()
.command(['login'])
.it('should be success login with message', (ctx): void => {
expect(ctx.stdout).to.equal(
'Allow Henesis to collect CLI usage and error reporting information\n🎉 Login Success from yoonsung@haechi.io 🎉\n',
);
});
test
.stub(
utils,
'confirmPrompt',
async (): Promise => {
return Promise.resolve(true);
},
)
.stub(
utils,
'emailPrompt',
async (): Promise => {
return Promise.resolve('yoonsung@haechi.io');
},
)
.stub(
utils,