diff options
author | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:01:11 +0200 |
---|---|---|
committer | Florian Dold <florian.dold@gmail.com> | 2017-08-14 05:02:09 +0200 |
commit | 363723fc84f7b8477592e0105aeb331ec9a017af (patch) | |
tree | 29f92724f34131bac64d6a318dd7e30612e631c7 /node_modules/ava/index.js.flow | |
parent | 5634e77ad96bfe1818f6b6ee70b7379652e5487f (diff) |
node_modules
Diffstat (limited to 'node_modules/ava/index.js.flow')
-rw-r--r-- | node_modules/ava/index.js.flow | 49 |
1 files changed, 6 insertions, 43 deletions
diff --git a/node_modules/ava/index.js.flow b/node_modules/ava/index.js.flow index 38670fc39..b86e22c65 100644 --- a/node_modules/ava/index.js.flow +++ b/node_modules/ava/index.js.flow @@ -58,8 +58,8 @@ type AssertContext = { // Assert that function throws an error or promise rejects. // @param error Can be a constructor, regex, error message or validation function. throws: { - (value: PromiseLike<mixed>, error?: ErrorValidator, message?: string): Promise<Error>; - (value: () => mixed, error?: ErrorValidator, message?: string): Error; + (value: PromiseLike<mixed>, error?: ErrorValidator, message?: string): Promise<any>; + (value: () => mixed, error?: ErrorValidator, message?: string): any; }; // Assert that function doesn't throw an error or promise resolves. notThrows: { @@ -84,9 +84,8 @@ type TestContext = AssertContext & { plan(count: number): void; skip: AssertContext; }; -type CallbackTestContext = TestContext & { end(): void; }; -type ContextualTestContext = TestContext & { context: any; }; -type ContextualCallbackTestContext = CallbackTestContext & { context: any; }; +type ContextualTestContext = TestContext & { context: any; }; +type ContextualCallbackTestContext = TestContext & { context: any; end(): void; }; /** * Test Implementations @@ -101,8 +100,6 @@ type TestImplementation<T, R> = | TestFunction<T, R> | Array<TestFunction<T, R>>; -type Test = TestImplementation<TestContext, SpecialReturnTypes | void>; -type CallbackTest = TestImplementation<CallbackTestContext, void>; type ContextualTest = TestImplementation<ContextualTestContext, SpecialReturnTypes | void>; type ContextualCallbackTest = TestImplementation<ContextualCallbackTestContext, void>; @@ -111,40 +108,6 @@ type ContextualCallbackTest = TestImplementation<ContextualCallbackTestContext, * Method Types */ -type TestMethod = { - ( implementation: Test): void; - (name: string, implementation: Test): void; - - serial : TestMethod; - before : TestMethod; - after : TestMethod; - skip : TestMethod; - todo : TestMethod; - failing : TestMethod; - only : TestMethod; - beforeEach : TestMethod; - afterEach : TestMethod; - cb : CallbackTestMethod; - always : TestMethod; -}; - -type CallbackTestMethod = { - ( implementation: CallbackTest): void; - (name: string, implementation: CallbackTest): void; - - serial : CallbackTestMethod; - before : CallbackTestMethod; - after : CallbackTestMethod; - skip : CallbackTestMethod; - todo : CallbackTestMethod; - failing : CallbackTestMethod; - only : CallbackTestMethod; - beforeEach : CallbackTestMethod; - afterEach : CallbackTestMethod; - cb : CallbackTestMethod; - always : CallbackTestMethod; -}; - type ContextualTestMethod = { ( implementation: ContextualTest): void; (name: string, implementation: ContextualTest): void; @@ -184,8 +147,8 @@ type ContextualCallbackTestMethod = { */ declare module.exports: { - ( run: ContextualTest): void; - (name: string, run: ContextualTest): void; + ( run: ContextualTest, ...args: any): void; + (name: string, run: ContextualTest, ...args: any): void; beforeEach : ContextualTestMethod; afterEach : ContextualTestMethod; |