Skip to content

Commit 5c2d2c4

Browse files
author
Sergey Chernyshev
committed
Added rollup tests
1 parent 04be679 commit 5c2d2c4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

tests/formatters/compact.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,27 @@
2020
"File with problems should list them": function() {
2121
var result = { messages: [
2222
{ type: "error", line: 2, col: 1, message: "BOGUS ERROR", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } },
23-
{ type: "warning", line: 1, col: 1, message: "BOGUS WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } }
23+
{ type: "warning", line: 1, col: 1, message: "BOGUS WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } },
24+
{ type: "warning", rollup: true, message: "BOGUS ROLLUP WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } }
2425
], stats: [] },
2526
err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR (BOGUS_RULE_ID)\n",
2627
warning = "path/to/FILE: line 1, col 1, Warning - BOGUS WARNING (BOGUS_RULE_ID)\n",
27-
expected = err + warning,
28+
rollupwarning = "path/to/FILE: Warning - BOGUS ROLLUP WARNING (BOGUS_RULE_ID)\n",
29+
expected = err + warning + rollupwarning,
2830
actual = CSSLint.getFormatter("compact").formatResults(result, "path/to/FILE", {fullPath: "/absolute/path/to/FILE"});
2931
Assert.areEqual(expected, actual);
3032
},
3133

3234
"Should output relative file paths": function() {
3335
var result = { messages: [
3436
{ type: "error", line: 2, col: 1, message: "BOGUS ERROR", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } },
35-
{ type: "warning", line: 1, col: 1, message: "BOGUS WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } }
37+
{ type: "warning", line: 1, col: 1, message: "BOGUS WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } },
38+
{ type: "warning", rollup: true, message: "BOGUS ROLLUP WARNING", evidence: "BOGUS", rule: { id: "BOGUS_RULE_ID" } }
3639
], stats: [] },
3740
err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR (BOGUS_RULE_ID)\n",
3841
warning = "path/to/FILE: line 1, col 1, Warning - BOGUS WARNING (BOGUS_RULE_ID)\n",
39-
expected = err + warning,
42+
rollupwarning = "path/to/FILE: Warning - BOGUS ROLLUP WARNING (BOGUS_RULE_ID)\n",
43+
expected = err + warning + rollupwarning,
4044
actual = CSSLint.getFormatter("compact").formatResults(result, "path/to/FILE", {fullPath: "/absolute/path/to/FILE"});
4145
Assert.areEqual(expected, actual);
4246
}

0 commit comments

Comments
 (0)