Skip to content

Commit 52731bb

Browse files
webwarrior-wsknocte
authored andcommitted
chore: fix testsx
1 parent 1157276 commit 52731bb

3 files changed

Lines changed: 17 additions & 13 deletions

File tree

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -644,6 +644,7 @@ test("should print help", async () => {
644644
-q, --quiet toggle console output [boolean] [default: false]
645645
-t, --to upper end of the commit range to lint; applies if edit=false [string]
646646
-V, --verbose enable verbose output for reports without problems [boolean]
647+
--legacy-output use the legacy input output format (single-line 'input: ...') [boolean]
647648
-s, --strict enable strict mode; result code 2 for warnings, 3 for errors [boolean]
648649
--options path to a JSON file or Common.js module containing CLI options
649650
-v, --version display version information [boolean]

@commitlint/cli/src/cli.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ const cli = yargs(process.argv.slice(2))
136136
description: "enable verbose output for reports without problems",
137137
},
138138
"legacy-output": {
139-
description: "use the legacy input output format (single-line 'input: ...')",
139+
description:
140+
"use the legacy input output format (single-line 'input: ...')",
140141
type: "boolean",
141142
},
142143
strict: {

@commitlint/format/src/format.test.ts

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -82,60 +82,62 @@ test("returns legacy output with full commit message if verbose and legacyOutput
8282
);
8383
});
8484

85-
test('returns input banner with errors and multi-line input', () => {
85+
test("returns input banner with errors and multi-line input", () => {
8686
const actual = format(
8787
{
8888
results: [
8989
{
9090
errors: [
9191
{
9292
level: 2,
93-
name: 'type-enum',
93+
name: "type-enum",
9494
message:
95-
'type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]',
95+
"type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]",
9696
},
9797
],
9898
warnings: [],
99-
input: 'foo: this is an invalid header\n\nThis is a body\n\nSigned-off-by: tester',
99+
input:
100+
"foo: this is an invalid header\n\nThis is a body\n\nSigned-off-by: tester",
100101
},
101102
],
102103
},
103104
{
104105
color: false,
105-
}
106+
},
106107
);
107108

108109
expect(actual).toStrictEqual(
109-
'⧗ --- input ---\nfoo: this is an invalid header\n\nThis is a body\n\nSigned-off-by: tester\n✖ type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]\n\n✖ found 1 problems, 0 warnings'
110+
"⧗ --- input ---\nfoo: this is an invalid header\n\nThis is a body\n\nSigned-off-by: tester\n✖ type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]\n\n✖ found 1 problems, 0 warnings\n",
110111
);
111112
});
112113

113-
test('returns legacy input banner with errors and multi-line input', () => {
114+
test("returns legacy input banner with errors and multi-line input", () => {
114115
const actual = format(
115116
{
116117
results: [
117118
{
118119
errors: [
119120
{
120121
level: 2,
121-
name: 'type-enum',
122+
name: "type-enum",
122123
message:
123-
'type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]',
124+
"type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test]",
124125
},
125126
],
126127
warnings: [],
127-
input: 'foo: this is an invalid header\n\nThis is a body\n\nSigned-off-by: tester',
128+
input:
129+
"foo: this is an invalid header\n\nThis is a body\n\nSigned-off-by: tester",
128130
},
129131
],
130132
},
131133
{
132134
color: false,
133135
legacyOutput: true,
134-
}
136+
},
135137
);
136138

137139
expect(actual).toStrictEqual(
138-
'⧗ input: foo: this is an invalid header\n\nThis is a body\n\nSigned-off-by: tester\n✖ type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]\n\n✖ found 1 problems, 0 warnings'
140+
"⧗ input: foo: this is an invalid header\n\nThis is a body\n\nSigned-off-by: tester\n✖ type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum]\n\n✖ found 1 problems, 0 warnings\n",
139141
);
140142
});
141143

0 commit comments

Comments
 (0)