diff --git a/types/jasmine-given/index.d.ts b/types/jasmine-given/index.d.ts index df2fe424a9..1275cf9738 100644 --- a/types/jasmine-given/index.d.ts +++ b/types/jasmine-given/index.d.ts @@ -1,7 +1,9 @@ // Type definitions for jasmine-given 2.6 // Project: https://github.com/searls/jasmine-given // Definitions by: Shai Reznik +// Dmitry Efimenko // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +// TypeScript Version: 2.1 /** Action method that should be called when the async work is complete */ interface DoneFn { @@ -11,9 +13,9 @@ interface DoneFn { fail: (message?: Error | string) => void; } -declare function Given(func: (done?: DoneFn) => void): void; -declare function When(func: (done?: DoneFn) => void): void; -declare function Then(func: (done?: DoneFn) => void): void; -declare function Then(label: string, func: (done?: DoneFn) => void): void; -declare function And(func: (done?: DoneFn) => void): void; -declare function Invariant(func: (done?: DoneFn) => void): void; +declare function Given(func: (done: DoneFn) => void): void; +declare function When(func: (done: DoneFn) => void): void; +declare function Then(func: (done: DoneFn) => void): void; +declare function Then(label: string, func: (done: DoneFn) => void): void; +declare function And(func: (done: DoneFn) => void): void; +declare function Invariant(func: (done: DoneFn) => void): void; diff --git a/types/jasmine-given/jasmine-given-tests.ts b/types/jasmine-given/jasmine-given-tests.ts index 10a6b824fe..0c2fd4fb67 100644 --- a/types/jasmine-given/jasmine-given-tests.ts +++ b/types/jasmine-given/jasmine-given-tests.ts @@ -11,61 +11,41 @@ And(() => { }); Invariant(() => { }); Given((done) => { - if (done) { - done(); - } + done(); }); When((done) => { - if (done) { - done(); - } + done(); }); Then('expected condition 2', (done) => { - if (done) { - done(); - } + done(); }); And((done) => { - if (done) { - done(); - } + done(); }); Invariant((done) => { - if (done) { - done(); - } + done(); }); Given((done) => { - if (done) { - done.fail(); - } + done.fail(); }); When((done) => { - if (done) { - done.fail(); - } + done.fail(); }); Then('expected condition 2', (done) => { - if (done) { - done.fail(); - } + done.fail(); }); And((done) => { - if (done) { - done.fail(); - } + done.fail(); }); Invariant((done) => { - if (done) { - done.fail(); - } + done.fail(); });