Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: mock timers in example #12385

Merged
merged 3 commits into from Feb 24, 2022
Merged

docs: mock timers in example #12385

merged 3 commits into from Feb 24, 2022

Commits on Feb 14, 2022

  1. Changes in __tests__/infiniteTimerGame-test.js

    while running  __tests__/infiniteTimerGame-test.js, i got following error:
    
    expect(received).toHaveBeenCalledTimes(expected)
    
        Matcher error: received value must be a mock or spy function
    
        Received has type:  function
        Received has value: [Function setTimeout]
    
          12 |     // At this point in time, there should have been a single call to
          13 |     // setTimeout to schedule the end of the game in 1 second.
        > 14 |     expect(setTimeout).toHaveBeenCalledTimes(1);
             |                        ^
          15 |     expect(setTimeout).toHaveBeenLastCalledWith(expect.any(Function), 1000);
    
    so i added, jest.spyOn(global, 'setTimeout');
    aditya04848 committed Feb 14, 2022
    Configuration menu
    Copy the full SHA
    2f3198f View commit details
    Browse the repository at this point in the history

Commits on Feb 23, 2022

  1. Configuration menu
    Copy the full SHA
    4ab9bb4 View commit details
    Browse the repository at this point in the history
  2. sync versions

    SimenB committed Feb 23, 2022
    Configuration menu
    Copy the full SHA
    111e4ed View commit details
    Browse the repository at this point in the history