1 | 'use strict';
|
2 |
|
3 | const cli = require('heroku-cli-util');
|
4 | cli.raiseErrors = true;
|
5 |
|
6 | const assert = require('chai').assert;
|
7 | const commands = require('..').commands;
|
8 | const login = commands.find((c) => c.command === 'login');
|
9 |
|
10 | describe('login', () => {
|
11 |
|
12 | beforeEach(() => {
|
13 | cli.mockConsole();
|
14 | });
|
15 |
|
16 | describe('happy path', () => {
|
17 | it('logs in successfully', () => {
|
18 | let config = {
|
19 | flags: {},
|
20 | args: {},
|
21 | httpGitHost: 'git.heroku.com',
|
22 | auth: {
|
23 | password: 'abcd'
|
24 | }
|
25 | };
|
26 | return login.run(config).then(() => {
|
27 | console.log('stdout:', cli.stdout);
|
28 | console.log('stderr:', cli.stderr);
|
29 | assert.equal(cli.stderr, '');
|
30 | });
|
31 | });
|
32 | });
|
33 | });
|