Fix warnings when executing CLI without arguments.

Change-type: patch
Signed-off-by: Scott Lowe <scott@balena.io>
This commit is contained in:
Scott Lowe 2019-11-01 14:45:45 +01:00
parent 5f780a0947
commit 4a967b126b
2 changed files with 18 additions and 2 deletions

View File

@ -25,8 +25,8 @@ capitano.permission 'user', (done) ->
capitano.command
signature: '*'
action: ->
capitano.execute(command: 'help')
action: (params, options, done) ->
capitano.execute(command: 'help', done)
capitano.globalOption
signature: 'help'

View File

@ -134,4 +134,20 @@ describe('balena help', function() {
chai.expect(err.join('')).to.equal('');
});
it('should print simple help text when no arguments present', async () => {
const { out, err } = await runCommand('');
chai
.expect(cleanOutput(out))
.to.deep.equal(
cleanOutput([
SIMPLE_HELP,
'Run `balena help --verbose` to list additional commands',
GLOBAL_OPTIONS,
]),
);
chai.expect(err.join('')).to.equal('');
});
});