Skip to content

Commit

Permalink
tests: use --help flag as an arg to info
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesgeorge007 committed Aug 13, 2020
1 parent eeb51bf commit b9828ac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/info/info-help.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,22 @@ const descriptionText = 'Outputs information about your system and dependencies'

describe('should print help for info command', () => {
it('shows usage information on supplying help flag', () => {
const { stdout, stderr } = runInfo(['help'], __dirname);
const { stdout, stderr } = runInfo(['--help'], __dirname);
expect(stdout).toContain(usageText);
expect(stdout).toContain(descriptionText);
expect(stderr).toHaveLength(0);
});

it('should respect the --no-color flag', () => {
const { stdout, stderr } = runInfo(['help', '--no-color'], __dirname);
const { stdout, stderr } = runInfo(['--help', '--no-color'], __dirname);
options.enabled = true;
expect(stdout).not.toContain(yellow(usageText));
expect(stdout).toContain(descriptionText);
expect(stderr).toHaveLength(0);
});

it('should output all cli flags', () => {
const { stdout, stderr } = runInfo(['help'], __dirname);
const { stdout, stderr } = runInfo(['--help'], __dirname);
infoFlags.forEach((flag) => expect(stdout).toContain(`--${flag.name}`));
expect(stderr).toHaveLength(0);
});
Expand Down

0 comments on commit b9828ac

Please sign in to comment.