diff --git a/index.js.flow b/index.js.flow index 7ee249c32..9ebdf8482 100644 --- a/index.js.flow +++ b/index.js.flow @@ -93,26 +93,23 @@ type ContextualTestContext = TestContext & { context: any; }; type ContextualCallbackTestContext = CallbackTestContext & { context: any; }; /** - * Test Types + * Test Implementations */ -type Test = (t: TestContext) => SpecialReturnTypes | void; -type CallbackTest = (t: CallbackTestContext) => void; -type ContextualTest = (t: ContextualTestContext) => SpecialReturnTypes | void; -type ContextualCallbackTest = (t: ContextualCallbackTestContext) => void; - -/** - * Macro Types - */ - -type Macro = { - (t: T, ...args: Array): void; +type TestFunction = { + (t: T, ...args: Array): R; title?: (providedTitle: string, ...args: Array) => string; }; -type Macros = - | Macro - | Array>; +type TestImplementation = + | TestFunction + | Array>; + +type Test = TestImplementation; +type CallbackTest = TestImplementation; +type ContextualTest = TestImplementation; +type ContextualCallbackTest = TestImplementation; + /** * Method Types @@ -121,8 +118,6 @@ type Macros = type TestMethod = { ( implementation: Test): void; (name: string, implementation: Test): void; - ( implementation: Macros, ...args: Array): void; - (name: string, implementation: Macros, ...args: Array): void; serial : TestMethod; before : TestMethod; @@ -140,8 +135,6 @@ type TestMethod = { type CallbackTestMethod = { ( implementation: CallbackTest): void; (name: string, implementation: CallbackTest): void; - ( implementation: Macros, ...args: Array): void; - (name: string, implementation: Macros, ...args: Array): void; serial : CallbackTestMethod; before : CallbackTestMethod; @@ -159,8 +152,6 @@ type CallbackTestMethod = { type ContextualTestMethod = { ( implementation: ContextualTest): void; (name: string, implementation: ContextualTest): void; - ( implementation: Macros, ...args: Array): void; - (name: string, implementation: Macros, ...args: Array): void; serial : ContextualTestMethod; before : ContextualTestMethod; @@ -178,8 +169,6 @@ type ContextualTestMethod = { type ContextualCallbackTestMethod = { ( implementation: ContextualCallbackTest): void; (name: string, implementation: ContextualCallbackTest): void; - ( implementation: Macros, ...args: Array): void; - (name: string, implementation: Macros, ...args: Array): void; serial : ContextualCallbackTestMethod; before : ContextualCallbackTestMethod; @@ -201,8 +190,6 @@ type ContextualCallbackTestMethod = { declare module.exports: { ( run: ContextualTest): void; (name: string, run: ContextualTest): void; - ( run: Macros, ...args: Array): void; - (name: string, run: Macros, ...args: Array): void; beforeEach : TestMethod; afterEach : TestMethod;