Skip to content

Commit 657f5c4

Browse files
committed
test(cli): add regression test
1 parent 8d7a3d5 commit 657f5c4

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

@commitlint/cli/src/cli.test.ts

+10
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,16 @@ test('should produce success output with --verbose flag', async () => {
5252
expect(actual.stderr).toEqual('');
5353
});
5454

55+
test('should produce last commit and success output with --verbose flag', async () => {
56+
const cwd = await gitBootstrap('fixtures/simple');
57+
await execa('git', ['add', 'commitlint.config.js'], {cwd});
58+
await execa('git', ['commit', '-m', '"test: this should work"'], {cwd});
59+
const actual = await cli(['--last', '--verbose'], {cwd})();
60+
expect(actual.stdout).toContain('0 problems, 0 warnings');
61+
expect(actual.stdout).toContain('test: this should work');
62+
expect(actual.stderr).toEqual('');
63+
});
64+
5565
test('should produce no output with --quiet flag', async () => {
5666
const cwd = await gitBootstrap('fixtures/default');
5767
const actual = await cli(['--quiet'], {cwd})('foo: bar');

0 commit comments

Comments
 (0)