|
20 | 20 | "File with problems should list them": function() { |
21 | 21 | var result = { messages: [ |
22 | 22 | { 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" } } |
24 | 25 | ], stats: [] }, |
25 | 26 | err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR (BOGUS_RULE_ID)\n", |
26 | 27 | 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, |
28 | 30 | actual = CSSLint.getFormatter("compact").formatResults(result, "path/to/FILE", {fullPath: "/absolute/path/to/FILE"}); |
29 | 31 | Assert.areEqual(expected, actual); |
30 | 32 | }, |
31 | 33 |
|
32 | 34 | "Should output relative file paths": function() { |
33 | 35 | var result = { messages: [ |
34 | 36 | { 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" } } |
36 | 39 | ], stats: [] }, |
37 | 40 | err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR (BOGUS_RULE_ID)\n", |
38 | 41 | 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, |
40 | 44 | actual = CSSLint.getFormatter("compact").formatResults(result, "path/to/FILE", {fullPath: "/absolute/path/to/FILE"}); |
41 | 45 | Assert.areEqual(expected, actual); |
42 | 46 | } |
|
0 commit comments