Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adds before/after mocha hooks #7

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions x-pack/typings/mocha.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
/* tslint:disable */
// Type definitions for mocha 5.2
// 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>
// Andrew Bradley <https://github.com/cspotcode>
// Dmitrii Sorin <https://github.com/1999>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.1

declare namespace Mocha {


// #region Test interface augmentations

interface HookFunction {
/**
* [bdd, qunit, tdd] Describe a "hook" to execute the given callback `fn`. The name of the
* function is used as the name of the hook.
*
* - _Only available when invoked via the mocha CLI._
*/
(fn: any): void;

/**
* [bdd, qunit, tdd] Describe a "hook" to execute the given callback `fn`. The name of the
* function is used as the name of the hook.
*
* - _Only available when invoked via the mocha CLI._
*/
(fn: any): void;

/**
* [bdd, qunit, tdd] Describe a "hook" to execute the given `title` and callback `fn`.
*
* - _Only available when invoked via the mocha CLI._
*/
(name: string, fn?: any): void;

/**
* [bdd, qunit, tdd] Describe a "hook" to execute the given `title` and callback `fn`.
*
* - _Only available when invoked via the mocha CLI._
*/
(name: string, fn?: any): void;
}

/**
* Execute after running tests.
*
* - _Only available when invoked via the mocha CLI._
*
* @see https://mochajs.org/api/global.html#after
*/
let after: HookFunction;


/**
* Execute before running tests.
*
* - _Only available when invoked via the mocha CLI._
*
* @see https://mochajs.org/api/global.html#before
*/
let before: HookFunction;
}

declare module "mocha" {
export = Mocha;
}

declare const before: Mocha.HookFunction;
declare const after: Mocha.HookFunction;