From 659898602eeb75fb1456a80923329133636b1b3e Mon Sep 17 00:00:00 2001 From: Piotr Roszatycki Date: Thu, 8 Aug 2019 18:08:17 +0200 Subject: [PATCH] mocha-steps: update to 1.3 with mocha 6.0 (#37440) * mocha-steps: update to 1.3 with mocha 6.0 * mocha-steps: both export and declare global --- types/mocha-steps/index.d.ts | 12 +++++++++--- types/mocha-steps/mocha-steps-tests.ts | 10 ++++++++++ 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/types/mocha-steps/index.d.ts b/types/mocha-steps/index.d.ts index 8bd32496aa..3dc0bc17bf 100644 --- a/types/mocha-steps/index.d.ts +++ b/types/mocha-steps/index.d.ts @@ -1,10 +1,16 @@ -// Type definitions for mocha-steps 1.1 +// Type definitions for mocha-steps 1.3 // Project: https://github.com/rprieto/mocha-steps // Definitions by: AryloYeung +// Piotr Roszatycki // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.1 /// -declare var step: Mocha.IContextDefinition; -declare var xstep: Mocha.IContextDefinition; +export function step(title: string, fn?: Mocha.Func): Mocha.Test; +export function xstep(title: string, fn?: Mocha.Func): Mocha.Test; + +declare global { + function step(title: string, fn?: Mocha.Func): Mocha.Test; + function xstep(title: string, fn?: Mocha.Func): Mocha.Test; +} diff --git a/types/mocha-steps/mocha-steps-tests.ts b/types/mocha-steps/mocha-steps-tests.ts index 82d3712b30..1907e349f6 100644 --- a/types/mocha-steps/mocha-steps-tests.ts +++ b/types/mocha-steps/mocha-steps-tests.ts @@ -1,3 +1,5 @@ +import * as MochaSteps from "mocha-steps"; + describe("Mocha Steps Test", () => { step("Step Test", () => { const module_name = "mocha-steps"; @@ -6,4 +8,12 @@ describe("Mocha Steps Test", () => { xstep("Skip Step Test", () => { const module_name = "mocha-steps"; }); + + MochaSteps.step("Step Test", () => { + const module_name = "mocha-steps"; + }); + + MochaSteps.xstep("Skip Step Test", () => { + const module_name = "mocha-steps"; + }); });