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/browser')
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/array.spec.js38
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/grep.html51
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/grep.spec.js108
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/index.html33
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/large.html24
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/large.spec.js48
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/multiple-done.spec.js16
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/opts.html30
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/opts.spec.js5
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/stack-trace.html24
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/stack-trace.spec.js20
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/ui.html46
-rw-r--r--tests/lib/mocha-3.1.0/test/browser/ui.spec.js31
13 files changed, 0 insertions, 474 deletions
diff --git a/tests/lib/mocha-3.1.0/test/browser/array.spec.js b/tests/lib/mocha-3.1.0/test/browser/array.spec.js
deleted file mode 100644
index 26404f6a90..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/array.spec.js
+++ /dev/null
@@ -1,38 +0,0 @@
-describe('Array', function(){
- describe('#push()', function(){
- it('should append a value', function(){
- foo = 'asdf'
- var arr = [];
- arr.push('foo');
- arr.push('bar');
- arr.push('baz');
- assert('foo' == arr[0]); // to test indentation
- assert('bar' == arr[1]);
- assert('baz' == arr[2]);
- })
-
- it('should return the length', function(){
- var arr = [];
- assert(1 == arr.push('foo'));
- assert(2 == arr.push('bar'));
- assert(3 == arr.push('baz'));
- })
- })
-})
-
-describe('Array', function(){
- describe('#pop()', function(){
- it('should remove and return the last value', function(){
- var arr = [1,2,3];
- assert(arr.pop() == 3);
- assert(arr.pop() == 2);
- assert(arr.pop() == -1);
- })
-
- it('should adjust .length', function(){
- var arr = [1,2,3];
- arr.pop();
- assert(arr.length == 2);
- })
- })
-})
diff --git a/tests/lib/mocha-3.1.0/test/browser/grep.html b/tests/lib/mocha-3.1.0/test/browser/grep.html
deleted file mode 100644
index 0ba47c8533..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/grep.html
+++ /dev/null
@@ -1,51 +0,0 @@
-<html>
- <head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>mocha.setup('bdd')</script>
- <script>
- function assert(expr, msg) {
- if (!expr) throw new Error(msg || 'failed');
- }
- </script>
- <script src="grep.js"></script>
- </head>
- <body>
- <div id="mocha"></div>
- <script>
- (function(window) {
- var location = window.location;
- mocha.checkLeaks();
- var runner = mocha.run();
- setTimeout(run, 1000);
-
- function run() {
- var regex = [
- '.*', // All
- 'm{2}', // 'mm...m'
- '\\d', // Contains number
- '^\\d{2}(?=\\s\\d$)', // Start with 2 numbers and end with one
- '^@.*(?=\\(\\)$)', // Run @Array and @Function suite, but only function
- '^@(?!.*\\)$)', // Run @Array and @Function suite, but only properties
- '^co', // Start with 'co'
- 'first$', // Ends with 'first'
- '^co.*(?=second$)', // Starts with 'co', ends with 'second'
- '^Date:\\s01\/0(?:[1-4])\/2015$', // Run all tests between '01/[01-04]/2015'
- encodeURIComponent('^#'), // Run encoded => start with '#'
- encodeURIComponent('^[^a-z|0-9]+$') // Run encoded => only uppercase suites(include `it` fns), e.g: CONSTANTS
- ]
- , qs = location.search.replace('?grep=', '')
- , re = ~qs.indexOf('%') ? qs : decodeURIComponent(qs)
- , grep = regex[regex.indexOf(re) + 1];
-
- return grep
- ? location.search = 'grep=' + grep
- : false;
- }
- })(window);
- </script>
- </body>
-</html>
diff --git a/tests/lib/mocha-3.1.0/test/browser/grep.spec.js b/tests/lib/mocha-3.1.0/test/browser/grep.spec.js
deleted file mode 100644
index 9531b87aa9..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/grep.spec.js
+++ /dev/null
@@ -1,108 +0,0 @@
-// numbers
-describe('21', function() {
- it('1', function() {
- assert(true);
- });
- it('2', function() {
- assert(true);
- });
-});
-// symbols
-describe('@Array', function() {
- it('.pop()', function() {
- assert(true);
- });
- it('.push()', function() {
- assert(true);
- });
- it('.length', function() {
- assert(true);
- });
-});
-
-describe('@Function', function() {
- it('.call()', function() {
- assert(true);
- });
- it('.apply()', function() {
- assert(true);
- });
- it('.length', function() {
- assert(true);
- });
- it('.name', function() {
- assert(true);
- });
- it('.prototype', function() {
- assert(true);
- });
-});
-
-//url with hashtags
-describe('#Services',function() {
- describe('#http', function() {
- it('.createClient()', function() {
- assert(true);
- });
- it('.Server()', function() {
- assert(true);
- });
- });
- describe('#crypto', function() {
- it('.randomBytes()', function() {
- assert(true);
- });
- it('.Hmac()', function() {
- assert(true);
- });
- });
-});
-
-// Uppercase
-describe('CONSTANTS', function() {
- it('.STATUS_CODES', function() {
- assert(true);
- });
-});
-
-// Dates
-describe('Date:', function() {
- it('01/02/2015', function() {
- assert(true);
- });
- it('01/03/2015', function() {
- assert(true);
- });
- it('01/06/2015', function() {
- assert(true);
- });
-});
-
-// etc..
-describe('booking/summary', function() {
- it('should be run last', function() {
- assert(true);
- });
-});
-
-describe('component/booking/summary', function() {
- it('should be run second', function() {
- assert(true);
- });
-});
-
-describe('component/booking/intro', function() {
- it('should be run first', function() {
- assert(true);
- });
-});
-
-describe('contains numbers', function() {
- it('should run if the number 92 matching', function() {
- assert(true);
- });
-
- it('should run if the number 8 matching', function() {
- assert(true);
- });
-}); \ No newline at end of file
diff --git a/tests/lib/mocha-3.1.0/test/browser/index.html b/tests/lib/mocha-3.1.0/test/browser/index.html
deleted file mode 100644
index 9200b977e5..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/index.html
+++ /dev/null
@@ -1,33 +0,0 @@
-<html>
- <head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>mocha.setup('bdd')</script>
- <script>
- function assert(expr, msg) {
- if (!expr) throw new Error(msg || 'failed');
- }
- </script>
- <script src="array.js"></script>
- <script src="../acceptance/duration.js"></script>
- <script src="../acceptance/timeout.js"></script>
- <script src="multiple-done.js"></script>
- <script>
- onload = function(){
- mocha.checkLeaks();
- mocha.globals(['foo']);
- var runner = mocha.run();
-
- // runner.on('test end', function(test){
- // console.log(test.fullTitle());
- // });
- };
- </script>
- </head>
- <body>
- <div id="mocha"></div>
- </body>
-</html>
diff --git a/tests/lib/mocha-3.1.0/test/browser/large.html b/tests/lib/mocha-3.1.0/test/browser/large.html
deleted file mode 100644
index 1804b3a000..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/large.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
- <head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>mocha.setup('bdd')</script>
- <script>
- function assert(expr, msg) {
- if (!expr) throw new Error(msg || 'failed');
- }
- </script>
- <script src="large.js"></script>
- <script>
- onload = function(){
- mocha.run();
- };
- </script>
- </head>
- <body>
- <div id="mocha"></div>
- </body>
-</html>
diff --git a/tests/lib/mocha-3.1.0/test/browser/large.spec.js b/tests/lib/mocha-3.1.0/test/browser/large.spec.js
deleted file mode 100644
index 56757eae27..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/large.spec.js
+++ /dev/null
@@ -1,48 +0,0 @@
-var n = 30;
-while (n--) {
- describe('Array ' + n, function(){
- var arr;
-
- beforeEach(function(){
- arr = [1,2,3];
- })
-
- describe('#indexOf()', function(){
- it('should return -1 when the value is not present', function(){
- assert(-1 == arr.indexOf(5));
- })
-
- it('should return the correct index when the value is present', function(done){
- assert(0 == arr.indexOf(1));
- assert(1 == arr.indexOf(2));
- done();
- })
- })
- })
-}
-
-describe('something', function(){
- it('should provide a useful error', function(done){
- setTimeout(function(){
- throw new Error('boom');
- done();
- }, 1);
- })
-
- it('should provide an even better error on phantomjs', function(done){
- setTimeout(function(){
- var AssertionError = function(message, actual, expected) {
- this.message = message;
- this.actual = actual;
- this.expected = expected;
- this.showDiff = true;
- };
- AssertionError.prototype = Object.create(Error.prototype);
- AssertionError.prototype.name = 'AssertionError';
- AssertionError.prototype.constructor = AssertionError;
-
- mocha.throwError(new AssertionError('kabooom', 'text with a typo', 'text without a typo'));
- done();
- }, 1);
- })
-})
diff --git a/tests/lib/mocha-3.1.0/test/browser/multiple-done.spec.js b/tests/lib/mocha-3.1.0/test/browser/multiple-done.spec.js
deleted file mode 100644
index d8a9d49ae2..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/multiple-done.spec.js
+++ /dev/null
@@ -1,16 +0,0 @@
-describe('Multiple Done calls', function(){
- it('should report an error if done was called more than once', function(done){
- done();
- done();
- })
-
- it('should report an error if an exception happened async after done was called', function (done) {
- done();
- setTimeout(done, 50);
- })
-
- it('should report an error if an exception happened after done was called', function(done){
- done();
- throw new Error("thrown error");
- })
-})
diff --git a/tests/lib/mocha-3.1.0/test/browser/opts.html b/tests/lib/mocha-3.1.0/test/browser/opts.html
deleted file mode 100644
index ec49a418fc..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/opts.html
+++ /dev/null
@@ -1,30 +0,0 @@
-<html>
- <head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>
- mocha.setup({
- ui: 'bdd',
- globals: ['okGlobalA', 'okGlobalB', 'okGlobalC', 'callback*']
- }).timeout(1500)
- </script>
- <script>
- function assert(expr, msg) {
- if (!expr) throw new Error(msg || 'failed');
- }
- </script>
- <script src="opts.js"></script>
- <script src="../acceptance/globals.js"></script>
- <script>
- onload = function(){
- var runner = mocha.run();
- };
- </script>
- </head>
- <body>
- <div id="mocha"></div>
- </body>
-</html>
diff --git a/tests/lib/mocha-3.1.0/test/browser/opts.spec.js b/tests/lib/mocha-3.1.0/test/browser/opts.spec.js
deleted file mode 100644
index dbbc9ff172..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/opts.spec.js
+++ /dev/null
@@ -1,5 +0,0 @@
-describe('Options', function() {
- it('should set timeout value', function() {
- assert(this.test._timeout === 1500);
- });
-})
diff --git a/tests/lib/mocha-3.1.0/test/browser/stack-trace.html b/tests/lib/mocha-3.1.0/test/browser/stack-trace.html
deleted file mode 100644
index 0f267dab98..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/stack-trace.html
+++ /dev/null
@@ -1,24 +0,0 @@
-<html>
-<head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>mocha.setup('bdd')</script>
- <script>
- function assert(expr, err) {
- if (!expr) throw err;
- }
- </script>
- <script src="stack-trace.js"></script>
- <script>
- onload = function() {
- mocha.run();
- };
- </script>
-</head>
-<body>
-<div id="mocha"></div>
-</body>
-</html>
diff --git a/tests/lib/mocha-3.1.0/test/browser/stack-trace.spec.js b/tests/lib/mocha-3.1.0/test/browser/stack-trace.spec.js
deleted file mode 100644
index b39944db09..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/stack-trace.spec.js
+++ /dev/null
@@ -1,20 +0,0 @@
-'use strict';
-describe('Stack trace', function() {
- it('should prettify the stack-trace', function() {
- var err = new Error();
- // We do this fake stack-trace because we under development,
- // and our root isn't `node_modules`, `bower` or `components`
- err.stack = ['Error: failed'
- , 'at assert (stack-trace.html:11:30)'
- , 'at Context.<anonymous> (stack-trace.js:5:5)'
- , 'at callFn (http://localhost:63342/node_modules/mocha.js:4546:21)'
- , 'at Test.require.register.Runnable.run (http://localhost:63342/node_modules/mocha.js:4539:7)'
- , 'at Runner.require.register.Runner.runTest (http://localhost:63342/node_modules/mocha.js:4958:10)'
- , 'at http://localhost:63342/bower_components/mocha.js:5041:12'
- , 'at next (http://localhost:63342/bower_components/mocha.js:4883:14)'
- , 'at http://localhost:63342/bower_components/mocha.js:4893:7'
- , 'at next (http://localhost:63342/bower_components/mocha.js:4828:23)'
- , 'at http://localhost:63342/bower_components/mocha.js:4860:5'].join('\n');
- assert(false, err);
- });
-}); \ No newline at end of file
diff --git a/tests/lib/mocha-3.1.0/test/browser/ui.html b/tests/lib/mocha-3.1.0/test/browser/ui.html
deleted file mode 100644
index 071c7798a0..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/ui.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<html>
- <head>
- <title>Mocha</title>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1.0">
- <link rel="stylesheet" href="../../mocha.css" />
- <script src="../../mocha.js"></script>
- <script>mocha.setup('bdd')</script>
- <script>
- function assert(expr, msg) {
- if (!expr) throw new Error(msg || 'failed');
- }
- </script>
- <script src="ui.js"></script>
- </head>
- <body>
- <div id="mocha"></div>
- <script>
- (function(window) {
- var location = window.location;
- mocha.checkLeaks();
- var runner = mocha.run();
- var count = 0;
- setTimeout(run, 1000);
-
- function run() {
- var regex = [
- '', // All
- '%5C%24%5C.jQuery', // $.jQuery
- '%5C%24%5C.jQuery%20%5C.on%5C(%5C)', // $.jQuery .on()
- ]
- , qs = location.search.replace('?grep=', '')
- , re = ~qs.indexOf('%') ? qs : decodeURIComponent(qs)
- , grep = regex[regex.indexOf(re) + 1]
- , anchors = document.getElementsByTagName('a');
-
- // Locate first 'a' element w/ matching grep param; click it
- for (var i = 0; i < anchors.length; i++) {
- if (anchors[i].href && anchors[i].href.indexOf(grep) > -1)
- return void anchors[i].click();
- }
- }
- })(window);
- </script>
- </body>
-</html>
diff --git a/tests/lib/mocha-3.1.0/test/browser/ui.spec.js b/tests/lib/mocha-3.1.0/test/browser/ui.spec.js
deleted file mode 100644
index 48236e9497..0000000000
--- a/tests/lib/mocha-3.1.0/test/browser/ui.spec.js
+++ /dev/null
@@ -1,31 +0,0 @@
-// test titles containing regex-conflicting characters
-
-// leading $
-describe('$.jQuery', function() {
- // parens
- describe('.on()', function () {
- it('should set an event', function() {
- assert(true);
- });
- });
-
- describe('.off()', function () {
- it('should remove an event', function () {
-
- });
- });
-});
-
-// another generic describe block to verify it is absent
-// when greeping on $.jQuery
-describe('@Array', function() {
- it('.pop()', function() {
- assert(true);
- });
- it('.push()', function() {
- assert(true);
- });
- it('.length', function() {
- assert(true);
- });
-});