Skip to content

Commit 4f4e045

Browse files
committed
Fix no-empty related problems
1 parent 169c874 commit 4f4e045

File tree

3 files changed

+28
-9
lines changed

3 files changed

+28
-9
lines changed

packages/toolkit/src/tests/createAsyncThunk.test.ts

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,9 @@ describe('createAsyncThunk', () => {
125125

126126
try {
127127
await thunkFunction(dispatch, () => {}, undefined)
128-
} catch (e) {}
128+
} catch (e) {
129+
/* empty */
130+
}
129131

130132
expect(dispatch).toHaveBeenNthCalledWith(
131133
1,
@@ -161,7 +163,9 @@ describe('createAsyncThunk', () => {
161163

162164
try {
163165
await thunkFunction(dispatch, () => {}, undefined)
164-
} catch (e) {}
166+
} catch (e) {
167+
/* empty */
168+
}
165169

166170
expect(dispatch).toHaveBeenNthCalledWith(
167171
1,
@@ -200,7 +204,9 @@ describe('createAsyncThunk', () => {
200204

201205
try {
202206
await thunkFunction(dispatch, () => {}, undefined)
203-
} catch (e) {}
207+
} catch (e) {
208+
/* empty */
209+
}
204210

205211
expect(dispatch).toHaveBeenNthCalledWith(
206212
1,
@@ -245,7 +251,9 @@ describe('createAsyncThunk', () => {
245251

246252
try {
247253
await thunkFunction(dispatch, () => {}, undefined)
248-
} catch (e) {}
254+
} catch (e) {
255+
/* empty */
256+
}
249257

250258
expect(dispatch).toHaveBeenNthCalledWith(
251259
1,
@@ -290,7 +298,9 @@ describe('createAsyncThunk', () => {
290298

291299
try {
292300
await thunkFunction(dispatch, () => {}, undefined)
293-
} catch (e) {}
301+
} catch (e) {
302+
/* empty */
303+
}
294304

295305
expect(dispatch).toHaveBeenNthCalledWith(
296306
1,
@@ -344,7 +354,9 @@ describe('createAsyncThunk', () => {
344354

345355
try {
346356
await thunkFunction(dispatch, () => {}, undefined)
347-
} catch (e) {}
357+
} catch (e) {
358+
/* empty */
359+
}
348360

349361
expect(dispatch).toHaveBeenNthCalledWith(
350362
1,
@@ -631,7 +643,9 @@ describe('conditional skipping of asyncThunks', () => {
631643
const thunkPromise = asyncThunk(arg)(dispatch, getState, extra)
632644
thunkPromise.abort()
633645
await thunkPromise
634-
} catch (err) {}
646+
} catch (err) {
647+
/* empty */
648+
}
635649
expect(dispatch).not.toHaveBeenCalled()
636650
})
637651

@@ -961,6 +975,7 @@ describe('meta', () => {
961975
})
962976

963977
if (ret.meta.requestStatus === 'rejected' && ret.meta.rejectedWithValue) {
978+
/* empty */
964979
} else {
965980
// could be caused by a `throw`, `abort()` or `condition` - no `rejectedMeta` in that case
966981
// @ts-expect-error

packages/toolkit/src/tests/immutableStateInvariantMiddleware.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,9 @@ describe('createImmutableStateInvariantMiddleware', () => {
162162
it('Should not print a warning if "next" takes too long', () => {
163163
const next: MWNext = (action) => {
164164
const started = Date.now()
165-
while (Date.now() - started < 8) {}
165+
while (Date.now() - started < 8) {
166+
/* empty */
167+
}
166168
return action
167169
}
168170

packages/toolkit/src/tests/serializableStateInvariantMiddleware.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -606,7 +606,9 @@ describe('serializableStateInvariantMiddleware', () => {
606606
it('Should not print a warning if "reducer" takes too long', () => {
607607
const reducer: Reducer = (state = 42, action) => {
608608
const started = Date.now()
609-
while (Date.now() - started < 8) {}
609+
while (Date.now() - started < 8) {
610+
/** No-Op */
611+
}
610612
return state
611613
}
612614

0 commit comments

Comments
 (0)