Added onFinish function to @types/tape (#16301)

This commit is contained in:
Dennis Schwartz
2017-05-03 19:58:52 +01:00
committed by Mohamed Hegazy
parent 08b6b892b4
commit 02151eb220
2 changed files with 10 additions and 2 deletions

11
types/tape/index.d.ts vendored
View File

@@ -1,6 +1,8 @@
// Type definitions for tape v4.2.2
// Type definitions for tape v4.2.29
// Project: https://github.com/substack/tape
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>, Haoqun Jiang <https://github.com/sodatea>
// Definitions by: Bart van der Schoor <https://github.com/Bartvds>
// Haoqun Jiang <https://github.com/sodatea>
// Dennis Schwartz <https://github.com/DennisSchwartz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
/// <reference types="node" />
@@ -44,6 +46,11 @@ declare namespace tape {
*/
export function skip(name: string, cb: tape.TestCase): void;
/**
* The onFinish hook will get invoked when ALL tape tests have finished right before tape is about to print the test summary.
*/
export function onFinish(cb: () => void): void;
/**
* Like test(name, cb) except if you use .only this is the only test case that will run for the entire process, all other test cases using tape will be ignored.
*/

View File

@@ -16,6 +16,7 @@ tape(name, (test: tape.Test) => {
tape.skip(name, cb);
tape.only(name, cb);
tape.onFinish(() => {});
var sopts: tape.StreamOptions;