Skip to content

Commit 8a2b250

Browse files
committed
test(linter): fix incorrect test fixture for prefer-each (#10587)
1 parent 91ce77a commit 8a2b250

File tree

2 files changed

+94
-236
lines changed

2 files changed

+94
-236
lines changed

crates/oxc_linter/src/rules/jest/prefer_each.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -172,44 +172,44 @@ fn test() {
172172

173173
let fail_jest = vec![
174174
"for (const [input, expected] of data) {
175-
it(\\`results in $\\{expected}\\`, () => {
175+
it(`results in ${expected}`, () => {
176176
expect(fn(input)).toBe(expected)
177177
});
178178
}",
179179
"for (const [input, expected] of data) {
180-
describe(\\`when the input is $\\{input}\\`, () => {
181-
it(\\`results in $\\{expected}\\`, () => {
180+
describe(`when the input is ${input}`, () => {
181+
it(`results in ${expected}`, () => {
182182
expect(fn(input)).toBe(expected)
183183
});
184184
});
185185
}",
186186
"for (const [input, expected] of data) {
187-
describe(\\`when the input is $\\{input}\\`, () => {
188-
it(\\`results in $\\{expected}\\`, () => {
187+
describe(`when the input is ${input}`, () => {
188+
it(`results in ${expected}`, () => {
189189
expect(fn(input)).toBe(expected)
190190
});
191191
});
192192
}
193193
for (const [input, expected] of data) {
194-
it.skip(\\`results in $\\{expected}\\`, () => {
194+
it.skip(`results in ${expected}`, () => {
195195
expect(fn(input)).toBe(expected)
196196
});
197197
}",
198198
"for (const [input, expected] of data) {
199-
it.skip(\\`results in $\\{expected}\\`, () => {
199+
it.skip(`results in ${expected}`, () => {
200200
expect(fn(input)).toBe(expected)
201201
});
202202
}",
203203
"it('is true', () => {
204204
expect(true).toBe(false);
205205
});
206206
for (const [input, expected] of data) {
207-
it.skip(\\`results in $\\{expected}\\`, () => {
207+
it.skip(`results in ${expected}`, () => {
208208
expect(fn(input)).toBe(expected)
209209
});
210210
}",
211211
"for (const [input, expected] of data) {
212-
it.skip(\\`results in $\\{expected}\\`, () => {
212+
it.skip(`results in ${expected}`, () => {
213213
expect(fn(input)).toBe(expected)
214214
});
215215
}
@@ -220,44 +220,44 @@ fn test() {
220220
expect(true).toBe(false);
221221
});
222222
for (const [input, expected] of data) {
223-
it.skip(\\`results in $\\{expected}\\`, () => {
223+
it.skip(`results in ${expected}`, () => {
224224
expect(fn(input)).toBe(expected)
225225
});
226226
}
227227
it('is true', () => {
228228
expect(true).toBe(false);
229229
});",
230230
"for (const [input, expected] of data) {
231-
it(\\`results in $\\{expected}\\`, () => {
231+
it(`results in ${expected}`, () => {
232232
expect(fn(input)).toBe(expected)
233233
});
234-
it(\\`results in $\\{expected}\\`, () => {
234+
it(`results in ${expected}`, () => {
235235
expect(fn(input)).toBe(expected)
236236
});
237237
}",
238238
"for (const [input, expected] of data) {
239-
it(\\`results in $\\{expected}\\`, () => {
239+
it(`results in ${expected}`, () => {
240240
expect(fn(input)).toBe(expected)
241241
});
242242
}
243243
for (const [input, expected] of data) {
244-
it(\\`results in $\\{expected}\\`, () => {
244+
it(`results in ${expected}`, () => {
245245
expect(fn(input)).toBe(expected)
246246
});
247247
}",
248248
"for (const [input, expected] of data) {
249-
it(\\`results in $\\{expected}\\`, () => {
249+
it(`results in ${expected}`, () => {
250250
expect(fn(input)).toBe(expected)
251251
});
252252
}
253253
for (const [input, expected] of data) {
254-
test(\\`results in $\\{expected}\\`, () => {
254+
test(`results in ${expected}`, () => {
255255
expect(fn(input)).toBe(expected)
256256
});
257257
}",
258258
"for (const [input, expected] of data) {
259259
beforeEach(() => setupSomething(input));
260-
test(\\`results in $\\{expected}\\`, () => {
260+
test(`results in ${expected}`, () => {
261261
expect(doSomething()).toBe(expected)
262262
});
263263
}",

0 commit comments

Comments
 (0)