@@ -13,99 +13,49 @@ const header = 'const test = require(\'ava\');\n';
13
13
14
14
ruleTester . run ( 'test-title' , rule , {
15
15
valid : [
16
- // Default options should be `['if-multiple']`
17
- header + 'test(t => { t.pass(); t.end(); });' ,
18
- {
19
- code : header + 'test("my test name", t => { t.pass(); t.end(); });' ,
20
- options : [ 'always' ]
21
- } ,
22
- {
23
- code : header + 'test(`my test name`, t => { t.pass(); t.end(); });' ,
24
- options : [ 'always' ]
25
- } ,
26
- {
27
- code : header + 'test(\'my test name\', t => { t.pass(); t.end(); });' ,
28
- options : [ 'always' ]
29
- } ,
30
- {
31
- code : header + 'test.cb("my test name", t => { t.pass(); t.end(); });' ,
32
- options : [ 'always' ]
33
- } ,
34
- {
35
- code : header + 'test.todo("my test name");' ,
36
- options : [ 'always' ]
37
- } ,
38
- {
39
- code : header + 'test.before(t => {});' ,
40
- options : [ 'always' ]
41
- } ,
42
- {
43
- code : header + 'test.after(t => {});' ,
44
- options : [ 'always' ]
45
- } ,
46
- {
47
- code : header + 'test.beforeEach(t => {});' ,
48
- options : [ 'always' ]
49
- } ,
50
- {
51
- code : header + 'test.afterEach(t => {});' ,
52
- options : [ 'always' ]
53
- } ,
54
- {
55
- code : header + 'test.cb.before(t => {}); test.before.cb(t => {});' ,
56
- options : [ 'always' ]
57
- } ,
58
- {
59
- code : header + 'test(t => { t.pass(); t.end(); });' ,
60
- options : [ 'if-multiple' ]
61
- } ,
62
- {
63
- code : header + 'notTest(t => { t.pass(); t.end(); });' ,
64
- options : [ 'always' ]
65
- } ,
66
- {
67
- code : header + 'test(macroFn, arg1, arg2);' ,
68
- options : [ 'always' ]
69
- } ,
16
+ header + 'test("my test name", t => { t.pass(); t.end(); });' ,
17
+ header + 'test(`my test name`, t => { t.pass(); t.end(); });' ,
18
+ header + 'test(\'my test name\', t => { t.pass(); t.end(); });' ,
19
+ header + 'test.cb("my test name", t => { t.pass(); t.end(); });' ,
20
+ header + 'test.todo("my test name");' ,
21
+ header + 'test.before(t => {});' ,
22
+ header + 'test.after(t => {});' ,
23
+ header + 'test.beforeEach(t => {});' ,
24
+ header + 'test.afterEach(t => {});' ,
25
+ header + 'test.cb.before(t => {}); test.before.cb(t => {});' ,
26
+ header + 'notTest(t => { t.pass(); t.end(); });' ,
27
+ header + 'test([], arg1, arg2);' ,
28
+ header + 'test({}, arg1, arg2);' ,
70
29
// Shouldn't be triggered since it's not a test file
71
- {
72
- code : 'test(t => {});' ,
73
- options : [ 'always' ]
74
- }
30
+ 'test(t => {});'
75
31
] ,
76
32
invalid : [
77
33
{
78
- code : header + 'test(t => {}); test(t => {});' ,
34
+ code : header + 'test(t => {});' ,
35
+ errors
36
+ } ,
37
+ {
38
+ code : header + 'test(t => {}, "my test name");' ,
79
39
errors
80
40
} ,
81
41
{
82
42
code : header + 'test(t => { t.pass(); t.end(); });' ,
83
- options : [ 'always' ] ,
84
43
errors
85
44
} ,
86
45
{
87
46
code : header + 'test.cb(t => { t.pass(); t.end(); });' ,
88
- options : [ 'always' ] ,
89
47
errors
90
48
} ,
91
49
{
92
50
code : header + 'test.cb.skip(t => { t.pass(); t.end(); });' ,
93
- options : [ 'always' ] ,
94
51
errors
95
52
} ,
96
53
{
97
54
code : header + 'test(t => { t.pass(); t.end(); });' ,
98
- options : [ 'always' ] ,
99
55
errors
100
56
} ,
101
57
{
102
58
code : header + 'test.todo();' ,
103
- options : [ 'always' ] ,
104
- errors
105
- } ,
106
- {
107
- code : header + 'test(t => {}); test(t => {});' ,
108
- options : [ 'if-multiple' ] ,
109
59
errors
110
60
}
111
61
]
0 commit comments