Skip to content

Commit

Permalink
tests: add test case to ensure that help arg recognizes subcommands
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Aug 5, 2020
1 parent 6670866 commit 87d0163
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/help/help-commands.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ const { run } = require('../utils/test-utils');
const helpHeader = 'The build tool for modern web applications';

describe('commands help', () => {
it('recognizes subcommands', () => {
const { stderr } = run(__dirname, ['help', 'serve'], false);
expect(stderr).not.toContain('Unknown argument: help');
});

it('throws error for invalid command with --help flag', () => {
const { stderr } = run(__dirname, ['--help', 'myCommand'], false);
expect(stderr).toContain(`You provided an invalid command 'myCommand'`);
Expand Down

0 comments on commit 87d0163

Please sign in to comment.