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: ddf23cd97b40737d674806e7fedd03dd164e3727 (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();
  });