|
20 | 20 |
|
21 | 21 | "File with problems should list them": function() { |
22 | 22 | var result = { messages: [ |
23 | | - { type: 'error', line: 2, col: 1, message: 'BOGUS ERROR', evidence: 'BOGUS', rule: [] }, |
24 | | - { type: 'warning', line: 1, col: 1, message: 'BOGUS WARNING', evidence: 'BOGUS', rule: [] } |
| 23 | + { type: 'error', line: 2, col: 1, message: 'BOGUS ERROR', evidence: 'BOGUS', rule: { id: 'BOGUS_RULE_ID' } }, |
| 24 | + { type: 'warning', line: 1, col: 1, message: 'BOGUS WARNING', evidence: 'BOGUS', rule: { id: 'BOGUS_RULE_ID' } } |
25 | 25 | ], stats: [] }, |
26 | | - err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR\n", |
27 | | - warning = "path/to/FILE: line 1, col 1, Warning - BOGUS WARNING\n", |
| 26 | + err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR (BOGUS_RULE_ID)\n", |
| 27 | + warning = "path/to/FILE: line 1, col 1, Warning - BOGUS WARNING (BOGUS_RULE_ID)\n", |
28 | 28 | expected = err + warning, |
29 | 29 | actual = CSSLint.getFormatter("compact").formatResults(result, "path/to/FILE", {fullPath: "/absolute/path/to/FILE"}); |
30 | 30 | Assert.areEqual(expected, actual); |
31 | 31 | }, |
32 | 32 |
|
33 | 33 | "Should output relative file paths": function() { |
34 | 34 | var result = { messages: [ |
35 | | - { type: 'error', line: 2, col: 1, message: 'BOGUS ERROR', evidence: 'BOGUS', rule: [] }, |
36 | | - { type: 'warning', line: 1, col: 1, message: 'BOGUS WARNING', evidence: 'BOGUS', rule: [] } |
| 35 | + { type: 'error', line: 2, col: 1, message: 'BOGUS ERROR', evidence: 'BOGUS', rule: { id: 'BOGUS_RULE_ID' } }, |
| 36 | + { type: 'warning', line: 1, col: 1, message: 'BOGUS WARNING', evidence: 'BOGUS', rule: { id: 'BOGUS_RULE_ID' } } |
37 | 37 | ], stats: [] }, |
38 | | - err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR\n", |
39 | | - warning = "path/to/FILE: line 1, col 1, Warning - BOGUS WARNING\n", |
| 38 | + err = "path/to/FILE: line 2, col 1, Error - BOGUS ERROR (BOGUS_RULE_ID)\n", |
| 39 | + warning = "path/to/FILE: line 1, col 1, Warning - BOGUS WARNING (BOGUS_RULE_ID)\n", |
40 | 40 | expected = err + warning, |
41 | 41 | actual = CSSLint.getFormatter("compact").formatResults(result, "path/to/FILE", {fullPath: "/absolute/path/to/FILE"}); |
42 | 42 | Assert.areEqual(expected, actual); |
|
0 commit comments