mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-12 12:10:44 +08:00
Adding Mocha instance for "require('mocha')" used for testrunners
This commit is contained in:
@@ -167,3 +167,58 @@ function test_chaining(){
|
||||
.reporter('html')
|
||||
.reporter(function(){});
|
||||
}
|
||||
|
||||
import MochaDef = require('mocha');
|
||||
|
||||
function test_require_constructor_empty() {
|
||||
var instance = new MochaDef();
|
||||
}
|
||||
|
||||
function test_require_constructor_noOptions() {
|
||||
var instance = new MochaDef({});
|
||||
}
|
||||
|
||||
function test_require_constructor_allOptions() {
|
||||
var instance = new MochaDef({
|
||||
grep: /[a-z]*/,
|
||||
ui: 'tdd',
|
||||
reporter: 'dot',
|
||||
timeout: 500,
|
||||
bail: true
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function test_require_fluentParams() {
|
||||
var instance = new MochaDef();
|
||||
|
||||
instance.bail(true)
|
||||
.bail()
|
||||
.addFile('foo.js')
|
||||
.reporter('bdd')
|
||||
.ui('dot')
|
||||
.grep('[a-z]*')
|
||||
.grep(/[a-z]*/)
|
||||
.invert()
|
||||
.ignoreLeaks(true)
|
||||
.checkLeaks()
|
||||
.growl()
|
||||
.globals('foo')
|
||||
.globals(['bar', 'zap'])
|
||||
.useColors(true)
|
||||
.useInlineDiffs(true)
|
||||
.timeout(500)
|
||||
.slow(100)
|
||||
.enableTimeouts(true)
|
||||
.asyncOnly(false)
|
||||
.noHighlighting(true)
|
||||
.run();
|
||||
}
|
||||
|
||||
function test_run_withOnComplete() {
|
||||
var instance = new MochaDef();
|
||||
|
||||
instance.run((failures: any[]): void => {
|
||||
console.log(failures);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user