Merge pull request #2221 from otiai10/pr/update-mocha

Update mocha.d.ts: add `context` statement
This commit is contained in:
Masahiro Wakame
2014-05-21 15:06:04 +09:00
2 changed files with 21 additions and 1 deletions
+12
View File
@@ -12,6 +12,18 @@ function test_describe() {
});
}
function test_context() {
context('some context', () => { });
context.only('some context', () => { });
context.skip('some context', () => { });
context('some context', function() {
this.timeout(2000);
});
}
function test_it() {
it('does something', () => { });
+9 -1
View File
@@ -1,6 +1,6 @@
// Type definitions for mocha 1.17.1
// Project: http://visionmedia.github.io/mocha/
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/>
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid/> and otiai10 <https://github.com/otiai10>
// DefinitelyTyped: https://github.com/borisyankov/DefinitelyTyped
interface Mocha {
@@ -59,6 +59,14 @@ declare var describe : {
timeout(ms: number): void;
}
// alias for `describe`
declare var context : {
(contextTitle: string, spec: () => void): void;
only(contextTitle: string, spec: () => void): void;
skip(contextTitle: string, spec: () => void): void;
timeout(ms: number): void;
}
declare var it: {
(expectation: string, assertion?: () => void): void;
(expectation: string, assertion?: (done: MochaDone) => void): void;