Skip to content

Commit

Permalink
tests: assert for args length
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Oct 10, 2020
1 parent fe342f6 commit 2450de2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion packages/webpack-cli/__tests__/cli-executer.test.js
Expand Up @@ -41,7 +41,8 @@ describe('CLI Executer', () => {
});

it('runs enquirer options then runs webpack', async () => {
await cliExecuter();
const args = await cliExecuter();
expect(args.length).toBe(5);

// check that webpack options are actually being displayed that
// the user can select from
Expand Down
4 changes: 2 additions & 2 deletions packages/webpack-cli/lib/utils/cli-executer.js
Expand Up @@ -56,8 +56,8 @@ const run = async () => {
logger.info('\nExecuting CLI\n');
return args;
} catch (err) {
logger.error(`${err} Action Interrupted, use ${cyan('webpack-cli help')} to see possible options.`);
process.exit(1);
logger.error(`Action Interrupted, use ${cyan('webpack-cli help')} to see possible options.`);
process.exit(2);
}
};

Expand Down

0 comments on commit 2450de2

Please sign in to comment.