muu

DEPRECATED lightweight JS framework
git clone https://git.ce9e.org/muu.git

commit
6289083659e7bdaee1dbb854867d591a1d9e31fe
parent
824e80a4738158b4135e7e528c1b54d74fd75abf
Author
Tobias Bengfort <tobias.bengfort@gmx.net>
Date
2015-08-28 14:35
mv test runner code to separate file

Diffstat

M test/index.html 56 +-------------------------------------------------------
C test/index.html -> test/run.js 137 +++++++++++++++++++++++--------------------------------------

2 files changed, 52 insertions, 141 deletions


diff --git a/test/index.html b/test/index.html

@@ -29,60 +29,6 @@
   29    29         data-cover-flags="branchTracking">
   30    30     </script>
   31    31 
   32    -1     <script>
   33    -1         mocha.setup('bdd');
   34    -1 
   35    -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    -1 
   41    -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    -1 
   55    -1             mocha.checkLeaks();
   56    -1             mocha.globals(['mochaResulsts']);
   57    -1             var runner = mocha.run();
   58    -1 
   59    -1             // generate output for saucelabs
   60    -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    -1 
   69    -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    -1 
   80    -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    32     <script src="run.js"></script>
   87    33 </body>
   88    34 </html>

diff --git a/test/index.html b/test/run.js

@@ -1,88 +1,53 @@
    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    -1 
    9    -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    -1 
   22    -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     <script
   27    -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    -1 
   32    -1     <script>
   33    -1         mocha.setup('bdd');
   34    -1 
   35    -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 (location.search.indexOf('coverage=no') === -1) {
   -1     4     blanket.options('filter', 'muu');
   -1     5 } else {
   -1     6     blanket.options('filter', 'nonexistent');
   -1     7 }
   -1     8 
   -1     9 require({
   -1    10     baseUrl: '../src/'
   -1    11 }, [
   -1    12     'muu-dom-helpers',
   -1    13     '../test/test-dom-helpers',
   -1    14     '../test/test-js-helpers.js',
   -1    15     '../test/test-template.js',
   -1    16     '../test/test-update-dom',
   -1    17     '../test/test-search',
   -1    18     '../test/test-directive',
   -1    19     '../test/test-registry'
   -1    20 ], function ($) {
   -1    21     $.DELAY = 5;
   -1    22 
   -1    23     mocha.checkLeaks();
   -1    24     mocha.globals(['mochaResulsts']);
   -1    25     var runner = mocha.run();
   -1    26 
   -1    27     // generate output for saucelabs
   -1    28     var flattenTitles = function(test) {
   -1    29         var titles = [];
   -1    30         while (test.parent.title) {
   -1    31             titles.push(test.parent.title);
   -1    32             test = test.parent;
   39    33         }
   40    -1 
   41    -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    -1 
   55    -1             mocha.checkLeaks();
   56    -1             mocha.globals(['mochaResulsts']);
   57    -1             var runner = mocha.run();
   58    -1 
   59    -1             // generate output for saucelabs
   60    -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    -1 
   69    -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    -1 
   80    -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    34         return titles.reverse();
   -1    35     };
   -1    36 
   -1    37     var failedTests = [];
   -1    38     var logFailure = function(test, err) {
   -1    39         failedTests.push({
   -1    40             name: test.title,
   -1    41             result: false,
   -1    42             message: err.message,
   -1    43             stack: err.stack,
   -1    44             titles: flattenTitles(test)
   85    45         });
   86    -1     </script>
   87    -1 </body>
   88    -1 </html>
   -1    46     };
   -1    47 
   -1    48     runner.on('fail', logFailure);
   -1    49     runner.on('end', function(){
   -1    50         window.mochaResults = runner.stats;
   -1    51         window.mochaResults.reports = failedTests;
   -1    52     });
   -1    53 });