From 823ae3de0286011972f4bfcc1e56b5368fb7d8db Mon Sep 17 00:00:00 2001 From: zs-zs Date: Thu, 6 Apr 2017 06:39:40 +0200 Subject: [PATCH 1/6] fix flowtypes --- index.js.flow | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js.flow b/index.js.flow index c05fbd902..38670fc39 100644 --- a/index.js.flow +++ b/index.js.flow @@ -187,8 +187,8 @@ declare module.exports: { ( run: ContextualTest): void; (name: string, run: ContextualTest): void; - beforeEach : TestMethod; - afterEach : TestMethod; + beforeEach : ContextualTestMethod; + afterEach : ContextualTestMethod; serial : ContextualTestMethod; before : ContextualTestMethod; after : ContextualTestMethod; From 99f8b61d5265ed702a70cd19cab2a1a1221e4381 Mon Sep 17 00:00:00 2001 From: zs-zs Date: Thu, 6 Apr 2017 10:56:26 +0200 Subject: [PATCH 2/6] remove irrelevant and obsolete test case for beforeEach --- test/flow-types/regression-1114.js.flow | 5 ----- 1 file changed, 5 deletions(-) diff --git a/test/flow-types/regression-1114.js.flow b/test/flow-types/regression-1114.js.flow index 616668dbf..612b815e9 100644 --- a/test/flow-types/regression-1114.js.flow +++ b/test/flow-types/regression-1114.js.flow @@ -25,11 +25,6 @@ test.cb(t => { t.end(); }); -test.beforeEach(t => { - // $ExpectError: Unknown property "context" - const context = t.context; -}) - function macro(t, input, expected) { t.is(eval(input), expected); } From a1a81954c8df2d1abb56618f5d9e434de943ba4e Mon Sep 17 00:00:00 2001 From: zs-zs Date: Thu, 6 Apr 2017 11:19:42 +0200 Subject: [PATCH 3/6] remove dead types --- index.js.flow | 41 ++--------------------------------------- 1 file changed, 2 insertions(+), 39 deletions(-) diff --git a/index.js.flow b/index.js.flow index 38670fc39..ebb7e90a0 100644 --- a/index.js.flow +++ b/index.js.flow @@ -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 = | TestFunction | Array>; -type Test = TestImplementation; -type CallbackTest = TestImplementation; type ContextualTest = TestImplementation; type ContextualCallbackTest = TestImplementation; @@ -111,40 +108,6 @@ type ContextualCallbackTest = TestImplementation Date: Thu, 6 Apr 2017 17:07:59 +0200 Subject: [PATCH 4/6] Revert "remove irrelevant and obsolete test case for beforeEach" This reverts commit 99f8b61d5265ed702a70cd19cab2a1a1221e4381. --- test/flow-types/regression-1114.js.flow | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/flow-types/regression-1114.js.flow b/test/flow-types/regression-1114.js.flow index 612b815e9..616668dbf 100644 --- a/test/flow-types/regression-1114.js.flow +++ b/test/flow-types/regression-1114.js.flow @@ -25,6 +25,11 @@ test.cb(t => { t.end(); }); +test.beforeEach(t => { + // $ExpectError: Unknown property "context" + const context = t.context; +}) + function macro(t, input, expected) { t.is(eval(input), expected); } From 0bfe8f625ce34a1cee523c55a6c84d3b2e5d129a Mon Sep 17 00:00:00 2001 From: zs-zs Date: Thu, 6 Apr 2017 17:08:52 +0200 Subject: [PATCH 5/6] remove $ExpectError --- test/flow-types/regression-1114.js.flow | 1 - 1 file changed, 1 deletion(-) diff --git a/test/flow-types/regression-1114.js.flow b/test/flow-types/regression-1114.js.flow index 616668dbf..307e85799 100644 --- a/test/flow-types/regression-1114.js.flow +++ b/test/flow-types/regression-1114.js.flow @@ -26,7 +26,6 @@ test.cb(t => { }); test.beforeEach(t => { - // $ExpectError: Unknown property "context" const context = t.context; }) From da81841eccca06fedced480b0adb969b4e0315cd Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Mon, 10 Apr 2017 09:17:48 +0100 Subject: [PATCH 6/6] Revert "remove dead types" This reverts commit a1a81954c8df2d1abb56618f5d9e434de943ba4e. --- index.js.flow | 41 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 39 insertions(+), 2 deletions(-) diff --git a/index.js.flow b/index.js.flow index ebb7e90a0..38670fc39 100644 --- a/index.js.flow +++ b/index.js.flow @@ -84,8 +84,9 @@ type TestContext = AssertContext & { plan(count: number): void; skip: AssertContext; }; -type ContextualTestContext = TestContext & { context: any; }; -type ContextualCallbackTestContext = TestContext & { context: any; end(): void; }; +type CallbackTestContext = TestContext & { end(): void; }; +type ContextualTestContext = TestContext & { context: any; }; +type ContextualCallbackTestContext = CallbackTestContext & { context: any; }; /** * Test Implementations @@ -100,6 +101,8 @@ type TestImplementation = | TestFunction | Array>; +type Test = TestImplementation; +type CallbackTest = TestImplementation; type ContextualTest = TestImplementation; type ContextualCallbackTest = TestImplementation; @@ -108,6 +111,40 @@ type ContextualCallbackTest = TestImplementation