@haechi-labs/henesis-cli
Version:
🚀 Command Line Interface tool to Utilize henesis
41 lines • 1.51 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const test_1 = require("@oclif/test");
const utils = tslib_1.__importStar(require("../../utils"));
const configstore_1 = tslib_1.__importDefault(require("../../common/configstore"));
describe('account:changepw', () => {
context('error occurred cases', async () => {
test_1.test
.stdout()
.command(['account:changepw'])
.exit(2)
.it('should be fail not logged in');
});
context('deploy spec when no error occurred', async () => {
before(() => {
configstore_1.default.set('user', {
email: 'yoonsung@haechi.io',
name: 'ys.choi',
organization: 'haechilabs',
jwtToken: 'asdf',
id: 43,
});
});
test_1.test
.nock('http://localhost:8080', (api) => api.patch('/users/v1/passwd').reply(200, {}))
.stub(utils, 'passwordPrompt', async () => {
return Promise.resolve('12345678');
})
.stdout()
.command(['account:changepw'])
.it('should be success Password change', (ctx) => {
test_1.expect(ctx.stdout).to.equal('🦄 Password changed!\n');
});
});
after(() => {
configstore_1.default.delete('user');
configstore_1.default.delete('analytics');
});
});
//# sourceMappingURL=changepw.spec.js.map