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

timeout.fixture.js « fixtures « integration « test « mocha-3.1.2 « lib « tests - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d23743681177f86eeb50f7ab159fac53439a61af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
'use strict';

describe('timeout', function () {
  this.timeout(1);

  it('should be honored with sync suites', function () {
    sleep(2);
  });

  it('should be honored with async suites', function (done) {
    sleep(2);
    done();
  });

  function sleep (ms) {
    var start = Date.now();
    while (start + ms > Date.now());
  }
});