@@ -4,22 +4,19 @@ import type {
44import type { VitestClient } from '@vitest/ws-client'
55
66const { get } = Reflect
7- const safeRandom = Math . random
87
98function withSafeTimers ( getTimers : typeof getSafeTimers , fn : ( ) => void ) {
109 const { setTimeout, clearTimeout, nextTick, setImmediate, clearImmediate } = getTimers ( )
1110
1211 const currentSetTimeout = globalThis . setTimeout
1312 const currentClearTimeout = globalThis . clearTimeout
14- const currentRandom = globalThis . Math . random
1513 const currentNextTick = globalThis . process . nextTick
1614 const currentSetImmediate = globalThis . setImmediate
1715 const currentClearImmediate = globalThis . clearImmediate
1816
1917 try {
2018 globalThis . setTimeout = setTimeout
2119 globalThis . clearTimeout = clearTimeout
22- globalThis . Math . random = safeRandom
2320 globalThis . process . nextTick = nextTick
2421 globalThis . setImmediate = setImmediate
2522 globalThis . clearImmediate = clearImmediate
@@ -30,7 +27,6 @@ function withSafeTimers(getTimers: typeof getSafeTimers, fn: () => void) {
3027 finally {
3128 globalThis . setTimeout = currentSetTimeout
3229 globalThis . clearTimeout = currentClearTimeout
33- globalThis . Math . random = currentRandom
3430 globalThis . setImmediate = currentSetImmediate
3531 globalThis . clearImmediate = currentClearImmediate
3632 nextTick ( ( ) => {
0 commit comments