How to use the mocha.run function in mocha

To help you get started, we’ve selected a few mocha examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github duan602728596 / antd-schema-form / tests / index.js View on Github external
await Promise.all([
    // 通用函数测试
    import('./tests/function/test'),
    // string类型组件测试
    import('./tests/string/test'),
    // number类型组件测试
    import('./tests/number/test'),
    // boolean类型组件测试
    import('./tests/boolean/test'),
    // array类型组件测试
    import('./tests/array/test'),
    // object类型组件测试
    import('./tests/object/test')
  ]);

  mocha.run();
})();
github jkroso / position / test / browser.js View on Github external
var mocha = require('mocha')

mocha.setup('bdd')

require('./index.test.js')

mocha.run(function () {
	window.scrollTo(0,0)
   console.log('Done!')
})
github typeiii / jquery-csv / test / scripts / app.js View on Github external
require(['test.js', 'jquery', 'jquery-csv'], function (require, $, csv) {
    $.csv = csv;
    if (window.mochaPhantomJS) {
      mochaPhantomJS.run();
    } else {
      mocha.run();
    }
  });
});
github cyverse / troposphere / tests / js / SpecRunner.js View on Github external
function (require) {
      if (window.mochaPhantomJS) {
        mochaPhantomJS.run();
      }
      else {
        mocha.run();
      }
    }
  );
github twigjs / twig.js / node_modules / mocha / mocha.js View on Github external
, key = pair.slice(0, i)
          , val = pair.slice(++i);

        obj[key] = decodeURIComponent(val);
        return obj;
      }, {});
  }

  mocha.setup = function(ui){
    ui = mocha.interfaces[ui];
    if (!ui) throw new Error('invalid mocha interface "' + ui + '"');
    ui(suite);
    suite.emit('pre-require', global);
  };

  mocha.run = function(){
    suite.emit('run');
    var runner = new mocha.Runner(suite);
    var reporter = new Reporter(runner);
    var query = parse(window.location.search || "");
    if (query.grep) runner.grep(new RegExp(query.grep));
    runner.run();
  };
})();
github assembl / assembl / assembl / static / js / app / init.js View on Github external
* http://chaijs.com/api/
 *
 * */

var mocha = require('mocha'),
    chai = require('chai'),
    chaiJquery = require('chai-jquery');

require('./tests/routes.spec.js');
require('./tests/context.spec.js');
require('./tests/models.spec.js');
require('./tests/utils.spec.js');
require('./tests/objects.spec.js');

chai.use(chaiJquery);
mocha.run();