@@ -22,6 +22,7 @@ ruleTester.run('no-accidental-space', rule, {
2222 'xit("foo", function () {})' ,
2323 'test("foo", function () {})' ,
2424 'xtest("foo", function () {})' ,
25+ 'xtest(`foo`, function () {})' ,
2526 'someFn("foo", function () {})' ,
2627 `
2728 describe('foo', () => {
@@ -33,34 +34,62 @@ ruleTester.run('no-accidental-space', rule, {
3334 {
3435 code : 'describe(" foo", function () {})' ,
3536 errors : [ { messageId : 'accidentalSpace' , column : 10 , line : 1 } ] ,
37+ output : 'describe("foo", function () {})' ,
38+ } ,
39+ {
40+ code : 'describe(" foo foe fum", function () {})' ,
41+ errors : [ { messageId : 'accidentalSpace' , column : 10 , line : 1 } ] ,
42+ output : 'describe("foo foe fum", function () {})' ,
3643 } ,
3744 {
3845 code : 'fdescribe(" foo", function () {})' ,
3946 errors : [ { messageId : 'accidentalSpace' , column : 11 , line : 1 } ] ,
47+ output : 'fdescribe("foo", function () {})' ,
48+ } ,
49+ {
50+ code : "fdescribe(' foo', function () {})" ,
51+ errors : [ { messageId : 'accidentalSpace' , column : 11 , line : 1 } ] ,
52+ output : "fdescribe('foo', function () {})" ,
4053 } ,
4154 {
4255 code : 'xdescribe(" foo", function () {})' ,
4356 errors : [ { messageId : 'accidentalSpace' , column : 11 , line : 1 } ] ,
57+ output : 'xdescribe("foo", function () {})' ,
4458 } ,
4559 {
4660 code : 'it(" foo", function () {})' ,
4761 errors : [ { messageId : 'accidentalSpace' , column : 4 , line : 1 } ] ,
62+ output : 'it("foo", function () {})' ,
4863 } ,
4964 {
5065 code : 'fit(" foo", function () {})' ,
5166 errors : [ { messageId : 'accidentalSpace' , column : 5 , line : 1 } ] ,
67+ output : 'fit("foo", function () {})' ,
5268 } ,
5369 {
5470 code : 'xit(" foo", function () {})' ,
5571 errors : [ { messageId : 'accidentalSpace' , column : 5 , line : 1 } ] ,
72+ output : 'xit("foo", function () {})' ,
5673 } ,
5774 {
5875 code : 'test(" foo", function () {})' ,
5976 errors : [ { messageId : 'accidentalSpace' , column : 6 , line : 1 } ] ,
77+ output : 'test("foo", function () {})' ,
78+ } ,
79+ {
80+ code : 'test(` foo`, function () {})' ,
81+ errors : [ { messageId : 'accidentalSpace' , column : 6 , line : 1 } ] ,
82+ output : 'test(`foo`, function () {})' ,
83+ } ,
84+ {
85+ code : 'test(` foo bar bang`, function () {})' ,
86+ errors : [ { messageId : 'accidentalSpace' , column : 6 , line : 1 } ] ,
87+ output : 'test(`foo bar bang`, function () {})' ,
6088 } ,
6189 {
6290 code : 'xtest(" foo", function () {})' ,
6391 errors : [ { messageId : 'accidentalSpace' , column : 7 , line : 1 } ] ,
92+ output : 'xtest("foo", function () {})' ,
6493 } ,
6594 {
6695 code : `
@@ -69,6 +98,11 @@ ruleTester.run('no-accidental-space', rule, {
6998 })
7099 ` ,
71100 errors : [ { messageId : 'accidentalSpace' , column : 16 , line : 2 } ] ,
101+ output : `
102+ describe('foo', () => {
103+ it('bar', () => {})
104+ })
105+ ` ,
72106 } ,
73107 {
74108 code : `
@@ -77,6 +111,11 @@ ruleTester.run('no-accidental-space', rule, {
77111 })
78112 ` ,
79113 errors : [ { messageId : 'accidentalSpace' , column : 12 , line : 3 } ] ,
114+ output : `
115+ describe('foo', () => {
116+ it('bar', () => {})
117+ })
118+ ` ,
80119 } ,
81120 ] ,
82121} ) ;
@@ -86,33 +125,66 @@ ruleTester.run('no-duplicate-prefix ft describe', rule, {
86125 'describe("foo", function () {})' ,
87126 'fdescribe("foo", function () {})' ,
88127 'xdescribe("foo", function () {})' ,
128+ 'xdescribe(`foo`, function () {})' ,
89129 ] ,
90130 invalid : [
91131 {
92132 code : 'describe("describe foo", function () {})' ,
93133 errors : [ { messageId : 'duplicatePrefix' , column : 10 , line : 1 } ] ,
134+ output : 'describe("foo", function () {})' ,
94135 } ,
95136 {
96137 code : 'fdescribe("describe foo", function () {})' ,
97138 errors : [ { messageId : 'duplicatePrefix' , column : 11 , line : 1 } ] ,
139+ output : 'fdescribe("foo", function () {})' ,
98140 } ,
99141 {
100142 code : 'xdescribe("describe foo", function () {})' ,
101143 errors : [ { messageId : 'duplicatePrefix' , column : 11 , line : 1 } ] ,
144+ output : 'xdescribe("foo", function () {})' ,
145+ } ,
146+ {
147+ code : "describe('describe foo', function () {})" ,
148+ errors : [ { messageId : 'duplicatePrefix' , column : 10 , line : 1 } ] ,
149+ output : "describe('foo', function () {})" ,
150+ } ,
151+ {
152+ code : 'fdescribe(`describe foo`, function () {})' ,
153+ errors : [ { messageId : 'duplicatePrefix' , column : 11 , line : 1 } ] ,
154+ output : 'fdescribe(`foo`, function () {})' ,
102155 } ,
103156 ] ,
104157} ) ;
105158
106159ruleTester . run ( 'no-duplicate-prefix ft test' , rule , {
107- valid : [ 'test("foo", function () {})' , 'xtest("foo", function () {})' ] ,
160+ valid : [
161+ 'test("foo", function () {})' ,
162+ "test('foo', function () {})" ,
163+ 'xtest("foo", function () {})' ,
164+ 'xtest(`foo`, function () {})' ,
165+ 'test("foo test", function () {})' ,
166+ 'xtest("foo test", function () {})' ,
167+ ] ,
108168 invalid : [
109169 {
110170 code : 'test("test foo", function () {})' ,
111171 errors : [ { messageId : 'duplicatePrefix' , column : 6 , line : 1 } ] ,
172+ output : 'test("foo", function () {})' ,
112173 } ,
113174 {
114175 code : 'xtest("test foo", function () {})' ,
115176 errors : [ { messageId : 'duplicatePrefix' , column : 7 , line : 1 } ] ,
177+ output : 'xtest("foo", function () {})' ,
178+ } ,
179+ {
180+ code : 'test(`test foo`, function () {})' ,
181+ errors : [ { messageId : 'duplicatePrefix' , column : 6 , line : 1 } ] ,
182+ output : 'test(`foo`, function () {})' ,
183+ } ,
184+ {
185+ code : 'test(`test foo test`, function () {})' ,
186+ errors : [ { messageId : 'duplicatePrefix' , column : 6 , line : 1 } ] ,
187+ output : 'test(`foo test`, function () {})' ,
116188 } ,
117189 ] ,
118190} ) ;
@@ -122,44 +194,85 @@ ruleTester.run('no-duplicate-prefix ft it', rule, {
122194 'it("foo", function () {})' ,
123195 'fit("foo", function () {})' ,
124196 'xit("foo", function () {})' ,
197+ 'xit(`foo`, function () {})' ,
198+ 'it("foos it correctly", function () {})' ,
125199 ] ,
126200 invalid : [
127201 {
128202 code : 'it("it foo", function () {})' ,
129203 errors : [ { messageId : 'duplicatePrefix' , column : 4 , line : 1 } ] ,
204+ output : 'it("foo", function () {})' ,
130205 } ,
131206 {
132207 code : 'fit("it foo", function () {})' ,
133208 errors : [ { messageId : 'duplicatePrefix' , column : 5 , line : 1 } ] ,
209+ output : 'fit("foo", function () {})' ,
134210 } ,
135211 {
136212 code : 'xit("it foo", function () {})' ,
137213 errors : [ { messageId : 'duplicatePrefix' , column : 5 , line : 1 } ] ,
214+ output : 'xit("foo", function () {})' ,
215+ } ,
216+ {
217+ code : 'it("it foos it correctly", function () {})' ,
218+ errors : [ { messageId : 'duplicatePrefix' , column : 4 , line : 1 } ] ,
219+ output : 'it("foos it correctly", function () {})' ,
138220 } ,
139221 ] ,
140222} ) ;
141223
142224ruleTester . run ( 'no-duplicate-prefix ft nested' , rule , {
143225 valid : [
144226 `
145- describe('foo', () => {
146- it('bar', () => {})
147- })` ,
227+ describe('foo', () => {
228+ it('bar', () => {})
229+ })
230+ ` ,
231+ `
232+ describe('foo', () => {
233+ it('describes things correctly', () => {})
234+ })
235+ ` ,
148236 ] ,
149237 invalid : [
150238 {
151239 code : `
152240 describe('describe foo', () => {
153241 it('bar', () => {})
154- })` ,
242+ })
243+ ` ,
155244 errors : [ { messageId : 'duplicatePrefix' , column : 16 , line : 2 } ] ,
245+ output : `
246+ describe('foo', () => {
247+ it('bar', () => {})
248+ })
249+ ` ,
250+ } ,
251+ {
252+ code : `
253+ describe('describe foo', () => {
254+ it('describes things correctly', () => {})
255+ })
256+ ` ,
257+ errors : [ { messageId : 'duplicatePrefix' , column : 16 , line : 2 } ] ,
258+ output : `
259+ describe('foo', () => {
260+ it('describes things correctly', () => {})
261+ })
262+ ` ,
156263 } ,
157264 {
158265 code : `
159266 describe('foo', () => {
160267 it('it bar', () => {})
161- })` ,
268+ })
269+ ` ,
162270 errors : [ { messageId : 'duplicatePrefix' , column : 12 , line : 3 } ] ,
271+ output : `
272+ describe('foo', () => {
273+ it('bar', () => {})
274+ })
275+ ` ,
163276 } ,
164277 ] ,
165278} ) ;
0 commit comments