Welcome to mirror list, hosted at ThFree Co, Russian Federation.

wait_using_real_timer.js « __helpers__ « frontend « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 110d5f46c08463d6d7e71eda137bd25bbbf927c9 (plain)
1
2
3
4
5
6
7
/* useful for timing promises when jest fakeTimers are not reliable enough */
export default (timeout) =>
  new Promise((resolve) => {
    jest.useRealTimers();
    setTimeout(resolve, timeout);
    jest.useFakeTimers();
  });