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

tdd.spec.js « interfaces « acceptance « 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: 7ad079e36de85b30f6466cbedb63960187efbdbc (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
suite('integer primitives', function(){
  suite('arithmetic', function(){
    var initialValue = 41;

    suiteSetup(function(done){
      expect(initialValue).to.eql(41);
      initialValue += 1;
      done();
    });

    test('should add', function(){
      expect(initialValue).to.eql(42);
      expect(1 + 1).to.equal(2);
      expect(2 + 2).to.equal(4);
    });

    test('should subtract', function(){
      expect(initialValue).to.eql(42);
      expect(1 - 1).to.equal(0);
      expect(2 - 1).to.equal(1);
    });

    test.skip('should skip this test', function(){
      var zero = 0;
      expect(zero).to.equal(1, 'this test should have been skipped');
    });

    suite.skip('should skip this suite', function(){
      test('should skip this test', function(){
        var zero = 0;
        expect(zero).to.equal(1, 'this test should have been skipped');
      });
    });

    suiteTeardown(function(done){
      expect(initialValue).to.eql(42);
      done();
    });
  });
});