Skip to content

Commit f0ba2de

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

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
@@ -52,6 +52,20 @@ 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+
const commit = await execa(
59+
'git',
60+
['commit', '-m', '"test: this should work"'],
61+
{cwd}
62+
);
63+
const actual = await cli(['--last', '--verbose'], {cwd})();
64+
expect(actual.stdout).toContain('0 problems, 0 warnings');
65+
expect(actual.stdout).toContain('test: this should work');
66+
expect(actual.stderr).toEqual('');
67+
});
68+
5569
test('should produce no output with --quiet flag', async () => {
5670
const cwd = await gitBootstrap('fixtures/default');
5771
const actual = await cli(['--quiet'], {cwd})('foo: bar');

0 commit comments

Comments
 (0)