UNPKG

@haechi-labs/henesis-cli

Version:

🚀 Command Line Interface tool to Utilize henesis

43 lines (42 loc) • 1.26 kB
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const test_1 = require('@oclif/test'); const utils = require('../utils'); const configstore_1 = require('../common/configstore'); describe('changepw', () => { context('error occurred cases', async () => { test_1.test .stdout() .command(['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(['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