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

globals.spec.js « acceptance « 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: b87df9fd99219a8d49e312545c2cd3182c6d5dea (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
43
'use strict';

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'
  });
});