Skip to content

Commit f3d4f16

Browse files
Mershoknocte
authored andcommitted
test(cli): add regression test
1 parent 16f5949 commit f3d4f16

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

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

+14
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,20 @@ test('should produce success output with --verbose flag', async () => {
4444
expect(actual.stderr).toEqual('');
4545
});
4646

47+
test('should produce last commit and success output with --verbose flag', async () => {
48+
const cwd = await gitBootstrap('fixtures/simple');
49+
await execa('git', ['add', 'commitlint.config.js'], {cwd});
50+
const commit = await execa(
51+
'git',
52+
['commit', '-m', '"test: this should work"'],
53+
{cwd}
54+
);
55+
const actual = await cli(['--last', '--verbose'], {cwd})();
56+
expect(actual.stdout).toContain('0 problems, 0 warnings');
57+
expect(actual.stdout).toContain('test: this should work');
58+
expect(actual.stderr).toEqual('');
59+
});
60+
4761
test('should produce no output with --quiet flag', async () => {
4862
const cwd = await gitBootstrap('fixtures/default');
4963
const actual = await cli(['--quiet'], {cwd})('foo: bar');

0 commit comments

Comments
 (0)