mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
jasmine-given: make done arg non-optional (#35842)
* jasmine-given: make done arg non-optional * simplify signature * fix readability for authors * clean up parentesis
This commit is contained in:
parent
06c371e17c
commit
d1f694fa3a
14
types/jasmine-given/index.d.ts
vendored
14
types/jasmine-given/index.d.ts
vendored
@ -1,7 +1,9 @@
|
||||
// Type definitions for jasmine-given 2.6
|
||||
// Project: https://github.com/searls/jasmine-given
|
||||
// Definitions by: Shai Reznik <https://github.com/shairez>
|
||||
// Dmitry Efimenko <https://github.com/DmitryEfimenko>
|
||||
// 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;
|
||||
|
||||
@ -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();
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user