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

suite.spec.js « 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: 00066a34f4a6fbd9a7305a3096b38b18f5780917 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
var assert = require('assert');
var run = require('./helpers').runMocha;
var args = [];

describe('suite w/no callback', function() {
  this.timeout(1000);
  it('should throw a helpful error message when a callback for suite is not supplied', function(done) {
    run('suite/suite-no-callback.fixture.js', args, function(err, res) {
      assert(!err);
      var result = res.output.match(/no callback was supplied/) || [];
      assert.equal(result.length, 1);
      done();
    });
  });
});

describe('skipped suite w/no callback', function() {
  this.timeout(1000);
  it('should not throw an error when a callback for skipped suite is not supplied', function(done) {
    run('suite/suite-skipped-no-callback.fixture.js', args, function(err, res) {
      assert(!err);
      pattern = new RegExp("Error", 'g');
      var result = res.output.match(pattern) || [];
      assert.equal(result.length, 0);
      done();
    });
  });
});


describe('skipped suite w/ callback', function() {
  this.timeout(1000);
  it('should not throw an error when a callback for skipped suite is supplied', function(done) {
    run('suite/suite-skipped-callback.fixture.js', args, function(err, res) {
      assert(!err);
      pattern = new RegExp("Error", 'g');
      var result = res.output.match(pattern) || [];
      assert.equal(result.length, 0);
      done();
    });
  });
});