Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

$interval ngMock has infinite loop when delay argument is equivalent to zero #15952

Closed
@luciomartinez

Description

@luciomartinez

I'm submitting a ...

  • bug report
  • feature request
  • other (Please do not submit support requests here (see above))

Current behavior:

When writing a spec if an interval is set with a delay argument equivalent to zero, then using the flush method will generate an infinite loop.

Expected behavior:

When running setInterval(..., 0); in the browser it is executed almost every tick, for mock the same behavior is expected.

Minimal reproduction of the problem with instructions:

https://plnkr.co/edit/uzZeMC8ruoEOT1l2MijI?p=preview

  1. Open the app.spec.js file
  2. Uncomment the line with the flush method

Result: the browser's tab will crush due infinite loop.

Angular version: 1.6.4

Browser: all

Anything else:

PhantomJS 2.1.1 (Windows 8 0.0.0) ERROR
  Disconnected, because no message in 10000 ms.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions