Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fakeAsync patch for requestAnimationFrame is not passing the timestamp #1216

Closed
santialbo opened this issue Apr 4, 2019 · 4 comments
Closed

Comments

@santialbo
Copy link

santialbo commented Apr 4, 2019

When requestAnimationFrame is patched in fakeAsync the callback is not called with a timestamp like it would be expected. Instead it's called with the callback itself.

  it('should patch requestAnimationFrame correctly', fakeAsync(() => {
    requestAnimationFrame((timestamp) => {
      // Fails: Expected 'function' to be 'number'.
      expect(typeof timestamp).toBe('number');
    });
    tick(16);
  }));

I created this repo with the failing test
https://github.com/santialbo/raf-zonejs-test/blob/4491d675287b2513e39244a368877bb951b19248/src/app/app.component.spec.ts#L32-L38
It's a standard cli generated project with just the failing test

@JiaLiPassion
Copy link
Collaborator

I will check it, thanks

@JiaLiPassion
Copy link
Collaborator

@santialbo, thank you, this is a bug, I have fixed it in #1220

JiaLiPassion added a commit to JiaLiPassion/zone.js that referenced this issue Apr 8, 2019
@santialbo-actimo
Copy link

Thank you so much!! do you have any idea when the next release of zone.js will be?

@JiaLiPassion
Copy link
Collaborator

@santialbo-actimo, I am not sure, but I think it will be released soon.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants