UNPKG

727 BJavaScriptView Raw
1'use strict';
2
3const cli = require('heroku-cli-util');
4cli.raiseErrors = true;
5
6const assert = require('chai').assert;
7const commands = require('..').commands;
8const login = commands.find((c) => c.command === 'login');
9
10describe('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});