@@ -13,12 +13,12 @@ const ruleTester = avaRuleTester(test, {
13
13
14
14
const errors = [ { ruleId : 'no-error-ctor-with-notthrows' } ] ;
15
15
16
- const header = ` const test = require('ava');\n` ; // eslint-disable-line quotes
16
+ const header = ' const test = require(\ 'ava\ ');\n' ;
17
17
18
18
ruleTester . run ( 'no-error-ctor-with-notthrows' , rule , {
19
19
valid : [
20
20
`${ header }
21
- test('some test',t => {
21
+ test('some test', t => {
22
22
t.notThrows(() => {
23
23
t.pass();
24
24
});
@@ -39,32 +39,31 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
39
39
});` ,
40
40
41
41
`${ header }
42
- test(t => {
43
- t.end(); })` ,
42
+ test(t => { t.end(); })` ,
44
43
45
44
`${ header }
46
- test('some test',t => {
45
+ test('some test', t => {
47
46
t.notThrows(() => {
48
47
t.pass();
49
48
}, true);
50
49
});` ,
51
50
52
51
`${ header }
53
- test('some test',t => {
52
+ test('some test', t => {
54
53
t.notThrows(() => {
55
54
t.pass();
56
55
}, 'some string');
57
56
});` ,
58
57
59
58
`${ header }
60
- test('some test',t => {
59
+ test('some test', t => {
61
60
t.notThrows(() => {
62
61
t.pass();
63
62
}, {firstName:'some', lastName: 'object'});
64
63
});` ,
65
64
66
65
`${ header }
67
- test('some test',t => {
66
+ test('some test', t => {
68
67
t.notThrowsAsync(() => {
69
68
t.pass();
70
69
});
@@ -78,19 +77,19 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
78
77
});` ,
79
78
80
79
`${ header }
81
- test('some test',t => {
80
+ test('some test', t => {
82
81
t.notThrowsAsync(() => {
83
82
t.pass();
84
83
}, {firstName:'some', lastName: 'object'});
85
84
});` ,
86
85
87
86
`${ header }
88
- test('some test',t => {
87
+ test('some test', t => {
89
88
notThrows(foo);
90
89
});` ,
91
90
92
91
`${ header }
93
- test('some test',t => {
92
+ test('some test', t => {
94
93
myCustomNotThrows.notThrows(foo);
95
94
});` ,
96
95
@@ -100,7 +99,7 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
100
99
}, void 0);` ,
101
100
102
101
// Shouldn't be triggered since it's not a test file
103
- `test('some test',t => {
102
+ `test('some test', t => {
104
103
t.notThrowsAsync(() => {
105
104
t.pass();
106
105
}, TypeError);
@@ -118,7 +117,7 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
118
117
} ,
119
118
{
120
119
code : `${ header }
121
- test('some test',t => {
120
+ test('some test', t => {
122
121
t.notThrows(() => {
123
122
t.pass();
124
123
}, TypeError);
@@ -136,7 +135,7 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
136
135
} ,
137
136
{
138
137
code : `${ header }
139
- test('some test',t => {
138
+ test('some test', t => {
140
139
t.notThrowsAsync(() => {
141
140
t.pass();
142
141
}, TypeError);
@@ -145,7 +144,7 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
145
144
} ,
146
145
{
147
146
code : `${ header }
148
- test('some test',t => {
147
+ test('some test', t => {
149
148
t.notThrowsAsync(() => {
150
149
t.pass();
151
150
}, Error);
@@ -154,7 +153,7 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
154
153
} ,
155
154
{
156
155
code : `${ header }
157
- test('some test',t => {
156
+ test('some test', t => {
158
157
t.notThrowsAsync(() => {
159
158
t.pass();
160
159
}, SyntaxError);
@@ -163,7 +162,7 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
163
162
} ,
164
163
{
165
164
code : `${ header }
166
- test('some test',t => {
165
+ test('some test', t => {
167
166
t.notThrowsAsync(() => {
168
167
t.pass();
169
168
}, AssertionError);
@@ -172,7 +171,7 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
172
171
} ,
173
172
{
174
173
code : `${ header }
175
- test('some test',t => {
174
+ test('some test', t => {
176
175
t.notThrowsAsync(() => {
177
176
t.pass();
178
177
}, ReferenceError);
@@ -181,7 +180,7 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
181
180
} ,
182
181
{
183
182
code : `${ header }
184
- test('some test',t => {
183
+ test('some test', t => {
185
184
t.notThrowsAsync(() => {
186
185
t.pass();
187
186
}, RangeError);
@@ -190,7 +189,7 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
190
189
} ,
191
190
{
192
191
code : `${ header }
193
- test('some test',t => {
192
+ test('some test', t => {
194
193
t.notThrowsAsync(() => {
195
194
t.pass();
196
195
}, SystemError);
@@ -199,7 +198,7 @@ ruleTester.run('no-error-ctor-with-notthrows', rule, {
199
198
} ,
200
199
{
201
200
code : `${ header }
202
- test('some test',t => {
201
+ test('some test', t => {
203
202
t.notThrowsAsync(() => {
204
203
t.pass();
205
204
}, $DOMError);
0 commit comments