Skip to content
This repository was archived by the owner on May 4, 2023. It is now read-only.

Commit c6e8bfb

Browse files
chore: add some mocked violations
1 parent c831eb8 commit c6e8bfb

1 file changed

Lines changed: 77 additions & 0 deletions

File tree

tests/fixtures/violationsMock.js

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
const violation1 = {
2+
filename: "test-file-1.js",
3+
start: {
4+
line: 1,
5+
col: 1,
6+
},
7+
end: {
8+
line: 1,
9+
col: 1,
10+
},
11+
message: "Invalid use of something",
12+
severity: "WARNING",
13+
category: "BEST_PRACTICE",
14+
};
15+
16+
const violation2 = {
17+
filename: "test-file-1.js",
18+
start: {
19+
line: 1,
20+
col: 1,
21+
},
22+
end: {
23+
line: 1,
24+
col: 1,
25+
},
26+
message: "Invalid use of something else",
27+
severity: "WARNING",
28+
category: "BEST_PRACTICE",
29+
};
30+
31+
const violation3 = {
32+
filename: "test-file-2.js",
33+
start: {
34+
line: 2,
35+
col: 2,
36+
},
37+
end: {
38+
line: 2,
39+
col: 2,
40+
},
41+
message: "Invalid use of something",
42+
severity: "INFORMATIONAL",
43+
category: "BEST_PRACTICE",
44+
};
45+
46+
export const violationsMock = [violation1, violation2, violation3];
47+
48+
export const violationsText = `Filename - Message (Severity/Category)
49+
test-file-1.js:1:1 - Invalid use of something (WARNING/BEST_PRACTICE)
50+
test-file-1.js:1:1 - Invalid use of something else (WARNING/BEST_PRACTICE)
51+
test-file-2.js:2:2 - Invalid use of something (INFORMATIONAL/BEST_PRACTICE)`;
52+
53+
export const violationsJson = `[
54+
{
55+
"filename": "test-file-1.js:1:1",
56+
"message": "Invalid use of something",
57+
"severity": "WARNING",
58+
"category": "BEST_PRACTICE"
59+
},
60+
{
61+
"filename": "test-file-1.js:1:1",
62+
"message": "Invalid use of something else",
63+
"severity": "WARNING",
64+
"category": "BEST_PRACTICE"
65+
},
66+
{
67+
"filename": "test-file-2.js:2:2",
68+
"message": "Invalid use of something",
69+
"severity": "INFORMATIONAL",
70+
"category": "BEST_PRACTICE"
71+
}
72+
]`;
73+
74+
export const violationsCsv = `File,Message,Severity,Category
75+
test-file-1.js:1:1,Invalid use of something,WARNING,BEST_PRACTICE
76+
test-file-1.js:1:1,Invalid use of something else,WARNING,BEST_PRACTICE
77+
test-file-2.js:2:2,Invalid use of something,INFORMATIONAL,BEST_PRACTICE`;

0 commit comments

Comments
 (0)