Skip to content

fakeAsync tests not working with lodash debounce #22826

@johnmcase

Description

@johnmcase

I'm submitting a...


[ ] Regression (a behavior that used to work and stopped working in a new release)
[ X ] Bug report  
[ ] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Using fakeAsync() and tick() to test functions that are debounced with lodash.debounce() do not work as expected.

Expected behavior

fakeAsync() and tick() should be able to be used to synchronously test debounced functions.

Minimal reproduction of the problem with instructions

I have a repository with a minimal reproduction: https://github.com/johnmcase/angular-test-debounce
Just clone, install, ng test

What is the motivation / use case for changing the behavior?

Environment


Angular version: 4.4.3 in the project I found this in.  5.2.0 in minimal reproduction

Browser:
- [ X ] Chrome (desktop) version XX
- [ ] Chrome (Android) version XX
- [ ] Chrome (iOS) version XX
- [ ] Firefox version XX
- [ ] Safari (desktop) version XX
- [ ] Safari (iOS) version XX
- [ ] IE version XX
- [ ] Edge version XX
 
For Tooling issues:
- Node version: 6.12.0  
- Platform:  Windows 10 

Others:

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: testingIssues related to Angular testing features, such as TestBed

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions