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

globals.spec.js « 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: f8ef804b23bf2e66ad67ddfca27ec09e17b15ebc (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
describe('global leaks', function(){
  before(function(){
    // uncomment to test
    // foo = 'hey';
    // bar = 'hey';
  })

  beforeEach(function(){
    // uncomment to test
    // foo = 'bar'
  });

  it('should cause tests to fail', function(){
    // uncomment to test
    // foo = 'bar';
    // bar = 'baz';
    // baz = 'raz';
  });

  it('should pass when accepted', function(){
    global.okGlobalA = 1;
    global.okGlobalB = 1;
    global.okGlobalC = 1;
  })

  it('should pass with wildcard', function(){
    global.callback123 = 'foo';
    global.callback345 = 'bar';
  });

  it('should pass when prefixed "mocha-"', function(){
    // Opera and IE do this for HTML element IDs anyway
    // but to sure we can assert this in any browser, simulate it.
    global['mocha-example'] = { nodeType: 1 };
  });

  afterEach(function(){
    // uncomment to test
    // foo = 'bar'
  });
});