Commit 3adda4b
tools,test: enforce assert.ifError with lint rule
This adds an ESLint rule to enforce the use of `assert.ifError(err)`
instead of `if (err) throw err;` in tests.
PR-URL: #10671
Ref: #10543
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gibson Fahnestock <gibfahn@gmail.com>
Reviewed-By: Michal Zasso <targos@protonmail.com>1 parent 727c5e3 commit 3adda4bCopy full SHA for 3adda4b
File tree
Expand file treeCollapse file tree
10 files changed
+63
-21
lines changedOpen diff view settings
Filter options
- test
- parallel
- pummel
- tools/eslint-rules
Expand file treeCollapse file tree
10 files changed
+63
-21
lines changedOpen diff view settings
Collapse file
+1Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
3 | 3 | |
4 | 4 | |
5 | 5 | |
| 6 | + |
6 | 7 | |
Collapse file
test/parallel/test-crypto-pbkdf2.js
Copy file name to clipboardExpand all lines: test/parallel/test-crypto-pbkdf2.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
52 | 52 | |
53 | 53 | |
54 | 54 | |
55 | | - |
| 55 | + |
56 | 56 | |
57 | 57 | |
58 | 58 | |
|
Collapse file
test/parallel/test-fs-long-path.js
Copy file name to clipboardExpand all lines: test/parallel/test-fs-long-path.js+3-2Lines changed: 3 additions & 2 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2 | 2 | |
3 | 3 | |
4 | 4 | |
| 5 | + |
5 | 6 | |
6 | 7 | |
7 | 8 | |
| ||
21 | 22 | |
22 | 23 | |
23 | 24 | |
24 | | - |
| 25 | + |
25 | 26 | |
26 | 27 | |
27 | | - |
| 28 | + |
28 | 29 | |
29 | 30 | |
30 | 31 | |
|
Collapse file
test/parallel/test-fs-readfile-pipe.js
Copy file name to clipboardExpand all lines: test/parallel/test-fs-readfile-pipe.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
15 | 15 | |
16 | 16 | |
17 | 17 | |
18 | | - |
| 18 | + |
19 | 19 | |
20 | 20 | |
21 | 21 | |
|
Collapse file
test/parallel/test-fs-symlink-dir-junction-relative.js
Copy file name to clipboardExpand all lines: test/parallel/test-fs-symlink-dir-junction-relative.js+1-1Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
15 | 15 | |
16 | 16 | |
17 | 17 | |
18 | | - |
| 18 | + |
19 | 19 | |
20 | 20 | |
21 | 21 | |
|
Collapse file
test/parallel/test-fs-symlink-dir-junction.js
Copy file name to clipboardExpand all lines: test/parallel/test-fs-symlink-dir-junction.js+4-4Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
14 | 14 | |
15 | 15 | |
16 | 16 | |
17 | | - |
| 17 | + |
18 | 18 | |
19 | 19 | |
20 | | - |
| 20 | + |
21 | 21 | |
22 | 22 | |
23 | 23 | |
24 | | - |
| 24 | + |
25 | 25 | |
26 | 26 | |
27 | 27 | |
28 | | - |
| 28 | + |
29 | 29 | |
30 | 30 | |
31 | 31 | |
|
Collapse file
test/parallel/test-preload.js
Copy file name to clipboardExpand all lines: test/parallel/test-preload.js+6-6Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
34 | 34 | |
35 | 35 | |
36 | 36 | |
37 | | - |
| 37 | + |
38 | 38 | |
39 | 39 | |
40 | 40 | |
41 | 41 | |
42 | 42 | |
43 | 43 | |
44 | 44 | |
45 | | - |
| 45 | + |
46 | 46 | |
47 | 47 | |
48 | 48 | |
| ||
63 | 63 | |
64 | 64 | |
65 | 65 | |
66 | | - |
| 66 | + |
67 | 67 | |
68 | 68 | |
69 | 69 | |
| ||
110 | 110 | |
111 | 111 | |
112 | 112 | |
113 | | - |
| 113 | + |
114 | 114 | |
115 | 115 | |
116 | 116 | |
| ||
131 | 131 | |
132 | 132 | |
133 | 133 | |
134 | | - |
| 134 | + |
135 | 135 | |
136 | 136 | |
137 | 137 | |
| ||
142 | 142 | |
143 | 143 | |
144 | 144 | |
145 | | - |
| 145 | + |
146 | 146 | |
147 | 147 | |
148 | 148 | |
Collapse file
test/pummel/test-regress-GH-814.js
Copy file name to clipboardExpand all lines: test/pummel/test-regress-GH-814.js+2-3Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2 | 2 | |
3 | 3 | |
4 | 4 | |
| 5 | + |
5 | 6 | |
6 | 7 | |
7 | 8 | |
| ||
59 | 60 | |
60 | 61 | |
61 | 62 | |
62 | | - |
63 | | - |
64 | | - |
| 63 | + |
65 | 64 | |
Collapse file
test/pummel/test-regress-GH-814_2.js
Copy file name to clipboardExpand all lines: test/pummel/test-regress-GH-814_2.js+2-3Lines changed: 2 additions & 3 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2 | 2 | |
3 | 3 | |
4 | 4 | |
| 5 | + |
5 | 6 | |
6 | 7 | |
7 | 8 | |
| ||
64 | 65 | |
65 | 66 | |
66 | 67 | |
67 | | - |
68 | | - |
69 | | - |
| 68 | + |
70 | 69 | |
71 | 70 | |
72 | 71 | |
|
Collapse file
tools/eslint-rules/prefer-assert-iferror.js
Copy file name to clipboard+42Lines changed: 42 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
0 commit comments