@types/mocha
Advanced tools
Comparing version 2.2.48 to 5.0.0
@@ -1,8 +0,13 @@ | ||
// Type definitions for mocha 2.2.5 | ||
// Type definitions for mocha 5.0 | ||
// Project: http://mochajs.org/ | ||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid>, otiai10 <https://github.com/otiai10>, jt000 <https://github.com/jt000>, Vadim Macagon <https://github.com/enlight> | ||
// Definitions by: Kazi Manzur Rashid <https://github.com/kazimanzurrashid> | ||
// otiai10 <https://github.com/otiai10> | ||
// jt000 <https://github.com/jt000> | ||
// Vadim Macagon <https://github.com/enlight> | ||
// Andrew Bradley <https://github.com/cspotcode> | ||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped | ||
// TypeScript Version: 2.1 | ||
interface MochaSetupOptions { | ||
//milliseconds to wait before considering a test slow | ||
// milliseconds to wait before considering a test slow | ||
slow?: number; | ||
@@ -14,5 +19,5 @@ | ||
// ui name "bdd", "tdd", "exports" etc | ||
ui?: string; | ||
ui?: Mocha.Interface; | ||
//array of accepted globals | ||
// array of accepted globals | ||
globals?: any[]; | ||
@@ -36,14 +41,14 @@ | ||
declare var mocha: Mocha; | ||
declare var describe: Mocha.IContextDefinition; | ||
declare var xdescribe: Mocha.IContextDefinition; | ||
declare const mocha: Mocha; | ||
declare const describe: Mocha.IContextDefinition; | ||
declare const xdescribe: Mocha.IContextDefinition; | ||
// alias for `describe` | ||
declare var context: Mocha.IContextDefinition; | ||
declare const context: Mocha.IContextDefinition; | ||
// alias for `describe` | ||
declare var suite: Mocha.IContextDefinition; | ||
declare var it: Mocha.ITestDefinition; | ||
declare var xit: Mocha.ITestDefinition; | ||
declare const suite: Mocha.IContextDefinition; | ||
declare const it: Mocha.ITestDefinition; | ||
declare const xit: Mocha.ITestDefinition; | ||
// alias for `it` | ||
declare var test: Mocha.ITestDefinition; | ||
declare var specify: Mocha.ITestDefinition; | ||
declare const test: Mocha.ITestDefinition; | ||
declare const specify: Mocha.ITestDefinition; | ||
@@ -53,18 +58,16 @@ // Used with the --delay flag; see https://mochajs.org/#hooks | ||
interface MochaDone { | ||
(error?: any): any; | ||
} | ||
type MochaDone = (error?: any) => void; | ||
declare function setup(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; | ||
declare function teardown(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; | ||
declare function suiteSetup(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; | ||
declare function suiteTeardown(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; | ||
declare function before(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; | ||
declare function before(description: string, callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; | ||
declare function after(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; | ||
declare function after(description: string, callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => any): void; | ||
declare function beforeEach(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; | ||
declare function beforeEach(description: string, callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; | ||
declare function afterEach(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; | ||
declare function afterEach(description: string, callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => any): void; | ||
declare function setup(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
declare function teardown(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
declare function suiteSetup(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
declare function suiteTeardown(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
declare function before(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
declare function before(description: string, callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
declare function after(callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
declare function after(description: string, callback: (this: Mocha.IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
declare function beforeEach(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
declare function beforeEach(description: string, callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
declare function afterEach(callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
declare function afterEach(description: string, callback: (this: Mocha.IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
@@ -87,2 +90,4 @@ interface ReporterConstructor { | ||
/** Setup mocha with the given interface. */ | ||
setup(interface: Mocha.Interface): Mocha; | ||
/** Setup mocha with the given options. */ | ||
@@ -125,2 +130,12 @@ setup(options: MochaSetupOptions): Mocha; | ||
declare namespace Mocha { | ||
/** Third-party declarations that want to add new interfaces can contribute names here */ | ||
interface InterfaceContributions { | ||
bdd: any; | ||
tdd: any; | ||
qunit: any; | ||
exports: any; | ||
} | ||
type Interface = keyof InterfaceContributions; | ||
interface ISuiteCallbackContext { | ||
@@ -138,3 +153,2 @@ timeout(ms: number | string): this; | ||
interface ITestCallbackContext { | ||
@@ -213,5 +227,5 @@ skip(): this; | ||
interface ITestDefinition { | ||
(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): ITest; | ||
only(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): ITest; | ||
skip(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => any): void; | ||
(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => PromiseLike<any> | void): ITest; | ||
only(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => PromiseLike<any> | void): ITest; | ||
skip(expectation: string, callback?: (this: ITestCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
timeout(ms: number | string): void; | ||
@@ -221,4 +235,4 @@ state: "failed" | "passed"; | ||
export module reporters { | ||
export class Base { | ||
namespace reporters { | ||
class Base { | ||
stats: IStats; | ||
@@ -229,15 +243,15 @@ | ||
export class Doc extends Base { } | ||
export class Dot extends Base { } | ||
export class HTML extends Base { } | ||
export class HTMLCov extends Base { } | ||
export class JSON extends Base { } | ||
export class JSONCov extends Base { } | ||
export class JSONStream extends Base { } | ||
export class Landing extends Base { } | ||
export class List extends Base { } | ||
export class Markdown extends Base { } | ||
export class Min extends Base { } | ||
export class Nyan extends Base { } | ||
export class Progress extends Base { | ||
class Doc extends Base { } | ||
class Dot extends Base { } | ||
class HTML extends Base { } | ||
class HTMLCov extends Base { } | ||
class JSON extends Base { } | ||
class JSONCov extends Base { } | ||
class JSONStream extends Base { } | ||
class Landing extends Base { } | ||
class List extends Base { } | ||
class Markdown extends Base { } | ||
class Min extends Base { } | ||
class Nyan extends Base { } | ||
class Progress extends Base { | ||
/** | ||
@@ -256,8 +270,66 @@ * @param options.open String used to indicate the start of the progress bar. | ||
} | ||
export class Spec extends Base { } | ||
export class TAP extends Base { } | ||
export class XUnit extends Base { | ||
class Spec extends Base { } | ||
class TAP extends Base { } | ||
class XUnit extends Base { | ||
constructor(runner: IRunner, options?: any); | ||
} | ||
} | ||
/* | ||
* All ambient functions are also available via require('mocha') when invoked via the mocha CLI | ||
* See for details: https://mochajs.org/#require | ||
*/ | ||
/** Only available when invoked via the mocha CLI */ | ||
const describe: IContextDefinition; | ||
/** Only available when invoked via the mocha CLI */ | ||
const xdescribe: IContextDefinition; | ||
/** | ||
* alias for `describe` | ||
* Only available when invoked via the mocha CLI | ||
*/ | ||
const context: IContextDefinition; | ||
/** | ||
* alias for `describe` | ||
* Only available when invoked via the mocha CLI | ||
*/ | ||
const suite: IContextDefinition; | ||
/** Only available when invoked via the mocha CLI */ | ||
const it: ITestDefinition; | ||
/** Only available when invoked via the mocha CLI */ | ||
const xit: ITestDefinition; | ||
/** | ||
* alias for `it` | ||
* Only available when invoked via the mocha CLI | ||
*/ | ||
const test: ITestDefinition; | ||
/** | ||
* Alias for `it` | ||
* Only available when invoked via the mocha CLI | ||
*/ | ||
const specify: ITestDefinition; | ||
/** Only available when invoked via the mocha CLI */ | ||
function setup(callback: (this: IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
/** Only available when invoked via the mocha CLI */ | ||
function teardown(callback: (this: IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
/** Only available when invoked via the mocha CLI */ | ||
function suiteSetup(callback: (this: IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
/** Only available when invoked via the mocha CLI */ | ||
function suiteTeardown(callback: (this: IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
/** Only available when invoked via the mocha CLI */ | ||
function before(callback: (this: IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
/** Only available when invoked via the mocha CLI */ | ||
function before(description: string, callback: (this: IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
/** Only available when invoked via the mocha CLI */ | ||
function after(callback: (this: IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
/** Only available when invoked via the mocha CLI */ | ||
function after(description: string, callback: (this: IHookCallbackContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
/** Only available when invoked via the mocha CLI */ | ||
function beforeEach(callback: (this: IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
/** Only available when invoked via the mocha CLI */ | ||
function beforeEach(description: string, callback: (this: IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
/** Only available when invoked via the mocha CLI */ | ||
function afterEach(callback: (this: IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
/** Only available when invoked via the mocha CLI */ | ||
function afterEach(description: string, callback: (this: IBeforeAndAfterContext, done: MochaDone) => PromiseLike<any> | void): void; | ||
} | ||
@@ -264,0 +336,0 @@ |
{ | ||
"name": "@types/mocha", | ||
"version": "2.2.48", | ||
"version": "5.0.0", | ||
"description": "TypeScript definitions for mocha", | ||
@@ -26,2 +26,7 @@ "license": "MIT", | ||
"githubUsername": "enlight" | ||
}, | ||
{ | ||
"name": "Andrew Bradley", | ||
"url": "https://github.com/cspotcode", | ||
"githubUsername": "cspotcode" | ||
} | ||
@@ -36,4 +41,4 @@ ], | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "27056d243d0717a72aece52a5c80847a49c9f9c5882241963aff6bfed2ee4a93", | ||
"typeScriptVersion": "2.0" | ||
"typesPublisherContentHash": "df351fe4d74abaa9859e9ed2e9334c4b55312b85c93f2677f2f3d34afa009fff", | ||
"typeScriptVersion": "2.1" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Wed, 31 Jan 2018 21:25:50 GMT | ||
* Last updated: Thu, 22 Mar 2018 17:52:41 GMT | ||
* Dependencies: none | ||
@@ -17,2 +17,2 @@ * Global values: Mocha, after, afterEach, before, beforeEach, context, describe, it, mocha, run, setup, specify, suite, suiteSetup, suiteTeardown, teardown, test, xdescribe, xit | ||
# Credits | ||
These definitions were written by Kazi Manzur Rashid <https://github.com/kazimanzurrashid>, otiai10 <https://github.com/otiai10>, jt000 <https://github.com/jt000>, Vadim Macagon <https://github.com/enlight>. | ||
These definitions were written by Kazi Manzur Rashid <https://github.com/kazimanzurrashid>, otiai10 <https://github.com/otiai10>, jt000 <https://github.com/jt000>, Vadim Macagon <https://github.com/enlight>, Andrew Bradley <https://github.com/cspotcode>. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16201
292