- commit
- dbd028a1002185e61cee8ad14474368d721aa7b5
- parent
- 824e80a4738158b4135e7e528c1b54d74fd75abf
- Author
- Tobias Bengfort <tobias.bengfort@gmx.net>
- Date
- 2015-08-28 14:36
Merge branch 'feature-test-stability'
Diffstat
| M | Gruntfile.js | 2 | +- |
| M | test/index.html | 67 | +------------------------------------------------------------ |
| C | test/index.html -> test/run.js | 139 | +++++++++++++++++++++++-------------------------------------- |
| A | test/travis.html | 29 | +++++++++++++++++++++++++++++ |
4 files changed, 84 insertions, 153 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
@@ -89,7 +89,7 @@ module.exports = function (grunt) {
89 89 all: {
90 90 options: {
91 91 urls: [
92 -1 'http://127.0.0.1:9999/test/'
-1 92 'http://127.0.0.1:9999/test/travis.html'
93 93 ],
94 94 browsers: browsers,
95 95 build: process.env.TRAVIS_JOB_ID,
diff --git a/test/index.html b/test/index.html
@@ -2,19 +2,8 @@ 2 2 <html> 3 3 <head> 4 4 <meta charset="utf-8">5 -1 <meta http-equiv="X-UA-Compatible" content="IE=edge">6 5 <title>Mocha Tests</title> 7 6 <link href="../lib/mocha/mocha.css" rel="stylesheet" />8 -19 -1 <!--[if IE 8]>10 -1 <script src="../lib/ie8/build/ie8.js"></script>11 -1 <script src="../lib/es5-shim/es5-shim.js"></script>12 -1 <script src="../lib/html5shiv/dist/html5shiv.js"></script>13 -1 <script>html5.addElements('muu');</script>14 -1 <![endif]-->15 -1 <!--[if lte IE 9]>16 -1 <script src="../lib/dom4/build/dom4.js"></script>17 -1 <![endif]-->18 7 </head> 19 8 <body> 20 9 <div id="mocha"></div> @@ -29,60 +18,6 @@ 29 18 data-cover-flags="branchTracking"> 30 19 </script> 31 2032 -1 <script>33 -1 mocha.setup('bdd');34 -135 -1 if (location.search.indexOf('coverage=no') === -1) {36 -1 blanket.options('filter', 'muu');37 -1 } else {38 -1 blanket.options('filter', 'nonexistent');39 -1 }40 -141 -1 require({42 -1 baseUrl: '../src/'43 -1 }, [44 -1 'muu-dom-helpers',45 -1 '../test/test-dom-helpers',46 -1 '../test/test-js-helpers.js',47 -1 '../test/test-template.js',48 -1 '../test/test-update-dom',49 -1 '../test/test-search',50 -1 '../test/test-directive',51 -1 '../test/test-registry'52 -1 ], function ($) {53 -1 $.DELAY = 5;54 -155 -1 mocha.checkLeaks();56 -1 mocha.globals(['mochaResulsts']);57 -1 var runner = mocha.run();58 -159 -1 // generate output for saucelabs60 -1 var flattenTitles = function(test) {61 -1 var titles = [];62 -1 while (test.parent.title) {63 -1 titles.push(test.parent.title);64 -1 test = test.parent;65 -1 }66 -1 return titles.reverse();67 -1 };68 -169 -1 var failedTests = [];70 -1 var logFailure = function(test, err) {71 -1 failedTests.push({72 -1 name: test.title,73 -1 result: false,74 -1 message: err.message,75 -1 stack: err.stack,76 -1 titles: flattenTitles(test)77 -1 });78 -1 };79 -180 -1 runner.on('fail', logFailure);81 -1 runner.on('end', function(){82 -1 window.mochaResults = runner.stats;83 -1 window.mochaResults.reports = failedTests;84 -1 });85 -1 });86 -1 </script>-1 21 <script src="run.js"></script> 87 22 </body> 88 23 </html>
diff --git a/test/index.html b/test/run.js
@@ -1,88 +1,55 @@1 -1 <!DOCTYPE html>2 -1 <html>3 -1 <head>4 -1 <meta charset="utf-8">5 -1 <meta http-equiv="X-UA-Compatible" content="IE=edge">6 -1 <title>Mocha Tests</title>7 -1 <link href="../lib/mocha/mocha.css" rel="stylesheet" />8 -19 -1 <!--[if IE 8]>10 -1 <script src="../lib/ie8/build/ie8.js"></script>11 -1 <script src="../lib/es5-shim/es5-shim.js"></script>12 -1 <script src="../lib/html5shiv/dist/html5shiv.js"></script>13 -1 <script>html5.addElements('muu');</script>14 -1 <![endif]-->15 -1 <!--[if lte IE 9]>16 -1 <script src="../lib/dom4/build/dom4.js"></script>17 -1 <![endif]-->18 -1 </head>19 -1 <body>20 -1 <div id="mocha"></div>21 -122 -1 <script src="../lib/mocha/mocha.js"></script>23 -1 <script src="../lib/expect.js/index.js"></script>24 -1 <script src="../lib/sinon-js/sinon.js"></script>25 -1 <script src="../lib/requirejs/require.js"></script>26 -1 <script27 -1 src="../lib/blanket/dist/qunit/blanket.js"28 -1 data-cover-adapter="../lib/blanket/src/adapters/mocha-blanket.js"29 -1 data-cover-flags="branchTracking">30 -1 </script>31 -132 -1 <script>33 -1 mocha.setup('bdd');34 -135 -1 if (location.search.indexOf('coverage=no') === -1) {36 -1 blanket.options('filter', 'muu');37 -1 } else {38 -1 blanket.options('filter', 'nonexistent');-1 1 mocha.setup('bdd'); -1 2 -1 3 if (window.blanket) { -1 4 if (location.search.indexOf('coverage=no') === -1) { -1 5 blanket.options('filter', 'muu'); -1 6 } else { -1 7 blanket.options('filter', 'nonexistent'); -1 8 } -1 9 } -1 10 -1 11 require({ -1 12 baseUrl: '../src/' -1 13 }, [ -1 14 'muu-dom-helpers', -1 15 '../test/test-dom-helpers', -1 16 '../test/test-js-helpers.js', -1 17 '../test/test-template.js', -1 18 '../test/test-update-dom', -1 19 '../test/test-search', -1 20 '../test/test-directive', -1 21 '../test/test-registry' -1 22 ], function ($) { -1 23 $.DELAY = 5; -1 24 -1 25 mocha.checkLeaks(); -1 26 mocha.globals(['mochaResulsts']); -1 27 var runner = mocha.run(); -1 28 -1 29 // generate output for saucelabs -1 30 var flattenTitles = function(test) { -1 31 var titles = []; -1 32 while (test.parent.title) { -1 33 titles.push(test.parent.title); -1 34 test = test.parent; 39 35 }40 -141 -1 require({42 -1 baseUrl: '../src/'43 -1 }, [44 -1 'muu-dom-helpers',45 -1 '../test/test-dom-helpers',46 -1 '../test/test-js-helpers.js',47 -1 '../test/test-template.js',48 -1 '../test/test-update-dom',49 -1 '../test/test-search',50 -1 '../test/test-directive',51 -1 '../test/test-registry'52 -1 ], function ($) {53 -1 $.DELAY = 5;54 -155 -1 mocha.checkLeaks();56 -1 mocha.globals(['mochaResulsts']);57 -1 var runner = mocha.run();58 -159 -1 // generate output for saucelabs60 -1 var flattenTitles = function(test) {61 -1 var titles = [];62 -1 while (test.parent.title) {63 -1 titles.push(test.parent.title);64 -1 test = test.parent;65 -1 }66 -1 return titles.reverse();67 -1 };68 -169 -1 var failedTests = [];70 -1 var logFailure = function(test, err) {71 -1 failedTests.push({72 -1 name: test.title,73 -1 result: false,74 -1 message: err.message,75 -1 stack: err.stack,76 -1 titles: flattenTitles(test)77 -1 });78 -1 };79 -180 -1 runner.on('fail', logFailure);81 -1 runner.on('end', function(){82 -1 window.mochaResults = runner.stats;83 -1 window.mochaResults.reports = failedTests;84 -1 });-1 36 return titles.reverse(); -1 37 }; -1 38 -1 39 var failedTests = []; -1 40 var logFailure = function(test, err) { -1 41 failedTests.push({ -1 42 name: test.title, -1 43 result: false, -1 44 message: err.message, -1 45 stack: err.stack, -1 46 titles: flattenTitles(test) 85 47 });86 -1 </script>87 -1 </body>88 -1 </html>-1 48 }; -1 49 -1 50 runner.on('fail', logFailure); -1 51 runner.on('end', function(){ -1 52 window.mochaResults = runner.stats; -1 53 window.mochaResults.reports = failedTests; -1 54 }); -1 55 });
diff --git a/test/travis.html b/test/travis.html
@@ -0,0 +1,29 @@
-1 1 <!DOCTYPE html>
-1 2 <html>
-1 3 <head>
-1 4 <meta charset="utf-8">
-1 5 <meta http-equiv="X-UA-Compatible" content="IE=edge">
-1 6 <title>Mocha Tests</title>
-1 7 <link href="../lib/mocha/mocha.css" rel="stylesheet" />
-1 8
-1 9 <!--[if IE 8]>
-1 10 <script src="../lib/ie8/build/ie8.js"></script>
-1 11 <script src="../lib/es5-shim/es5-shim.js"></script>
-1 12 <script src="../lib/html5shiv/dist/html5shiv.js"></script>
-1 13 <script>html5.addElements('muu');</script>
-1 14 <![endif]-->
-1 15 <!--[if lte IE 9]>
-1 16 <script src="../lib/dom4/build/dom4.js"></script>
-1 17 <![endif]-->
-1 18 </head>
-1 19 <body>
-1 20 <div id="mocha"></div>
-1 21
-1 22 <script src="../lib/mocha/mocha.js"></script>
-1 23 <script src="../lib/expect.js/index.js"></script>
-1 24 <script src="../lib/sinon-js/sinon.js"></script>
-1 25 <script src="../lib/requirejs/require.js"></script>
-1 26
-1 27 <script src="run.js"></script>
-1 28 </body>
-1 29 </html>