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

timeout.fixture.js « fixtures « integration « test « mocha-3.1.0 « lib « tests - github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d8c99b2bc36b4b9c9aa249db232aa929fd24fbf5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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());
  }
});