()
| 61 | it('should check that propertyDescriptor gets back after resetting timers', (t) => { |
| 62 | const getDescriptor = (ctx, fn) => Object.getOwnPropertyDescriptor(ctx, fn); |
| 63 | const getCurrentTimersDescriptors = () => { |
| 64 | const timers = [ |
| 65 | 'setTimeout', |
| 66 | 'clearTimeout', |
| 67 | 'setInterval', |
| 68 | 'clearInterval', |
| 69 | 'setImmediate', |
| 70 | 'clearImmediate', |
| 71 | ]; |
| 72 | |
| 73 | const globalTimersDescriptors = timers.map((fn) => getDescriptor(globalThis, fn)); |
| 74 | const nodeTimersDescriptors = timers.map((fn) => getDescriptor(nodeTimers, fn)); |
| 75 | const nodeTimersPromisesDescriptors = timers |
| 76 | .filter((fn) => !fn.includes('clear')) |
| 77 | .map((fn) => getDescriptor(nodeTimersPromises, fn)); |
| 78 | |
| 79 | return { |
| 80 | global: globalTimersDescriptors, |
| 81 | nodeTimers: nodeTimersDescriptors, |
| 82 | nodeTimersPromises: nodeTimersPromisesDescriptors, |
| 83 | }; |
| 84 | }; |
| 85 | |
| 86 | const originalDescriptors = getCurrentTimersDescriptors(); |
| 87 |
no test coverage detected