Skip to content

Commit 35370a2

Browse files
committed
Vary delay argument to ensure timeouts are not stale
1 parent 42663a7 commit 35370a2

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/middleware.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -181,14 +181,14 @@ test('middleware responds after delay with provided data', () => {
181181
[LP_API]: {
182182
isStub: true,
183183
stubData,
184-
delay: 500,
184+
delay: 1000,
185185
}
186186
}
187187

188188
const pendingPromise = store.dispatch(stubAction).then((res) => {
189189
expect(res).toEqual(stubData)
190190
expect(setTimeout).toHaveBeenCalledTimes(1)
191-
expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 500)
191+
expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 1000)
192192
})
193193

194194
// Activate the timer

0 commit comments

Comments
 (0)