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

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/lib/mocha-3.1.0/test/acceptance/globals.spec.js')
-rw-r--r--tests/lib/mocha-3.1.0/test/acceptance/globals.spec.js41
1 files changed, 41 insertions, 0 deletions
diff --git a/tests/lib/mocha-3.1.0/test/acceptance/globals.spec.js b/tests/lib/mocha-3.1.0/test/acceptance/globals.spec.js
new file mode 100644
index 0000000000..f8ef804b23
--- /dev/null
+++ b/tests/lib/mocha-3.1.0/test/acceptance/globals.spec.js
@@ -0,0 +1,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'
+ });
+});