Merge pull request #1493 from balena-io/1491-bugfix-no-arguments

Fix warnings when executing CLI without arguments.
This commit is contained in:
srlowe 2019-11-01 17:03:33 +01:00 committed by GitHub
commit 394f2e0999
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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('');
});
});