Skip to content

Commit

Permalink
test(cli): add regression test
Browse files Browse the repository at this point in the history
  • Loading branch information
Mersho authored and knocte committed Feb 14, 2024
1 parent 16f5949 commit f3d4f16
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions @commitlint/cli/src/cli.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,20 @@ test('should produce success output with --verbose flag', async () => {
expect(actual.stderr).toEqual('');
});

test('should produce last commit and success output with --verbose flag', async () => {
const cwd = await gitBootstrap('fixtures/simple');
await execa('git', ['add', 'commitlint.config.js'], {cwd});
const commit = await execa(
'git',
['commit', '-m', '"test: this should work"'],
{cwd}
);
const actual = await cli(['--last', '--verbose'], {cwd})();
expect(actual.stdout).toContain('0 problems, 0 warnings');
expect(actual.stdout).toContain('test: this should work');
expect(actual.stderr).toEqual('');
});

test('should produce no output with --quiet flag', async () => {
const cwd = await gitBootstrap('fixtures/default');
const actual = await cli(['--quiet'], {cwd})('foo: bar');
Expand Down

0 comments on commit f3d4f16

Please sign in to comment.