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

fakeAsync patch for requestAnimationFrame is not passing the timestamp #1216

@santialbo

Description

@santialbo

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions