()
| 33 | |
| 34 | |
| 35 | def test_clearInterval(): |
| 36 | async def async_fn(): |
| 37 | obj = {'val': 0} |
| 38 | pm.eval("""(obj) => { |
| 39 | const interval = setInterval(()=>{ obj.val++ }, 200) |
| 40 | setTimeout(()=>{ clearInterval(interval) }, 500) |
| 41 | }""")(obj) |
| 42 | await pm.wait() # It should stop after 500ms on the clearInterval |
| 43 | assert obj['val'] == 2 # The setInterval timer should only run twice (500 // 200 == 2) |
| 44 | return True |
| 45 | assert asyncio.run(async_fn()) |
| 46 | |
| 47 | |
| 48 | def test_finished_timer_ref(): |
nothing calls this directly
no test coverage detected