From d9c03e8f7116a219c2a3e825ddf79e5f6f897c43 Mon Sep 17 00:00:00 2001 From: LasaleFamine Date: Wed, 8 Feb 2017 21:30:51 +0100 Subject: [PATCH 1/2] Flow type definition for snapshot assertion #1245 --- index.js.flow | 2 ++ 1 file changed, 2 insertions(+) diff --git a/index.js.flow b/index.js.flow index 54367a94e..2e70718d6 100644 --- a/index.js.flow +++ b/index.js.flow @@ -68,6 +68,8 @@ type AssertContext = { }; // Assert that contents matches regex. regex(contents: string, regex: RegExp, message?: string): void; + // Assert that contents matches a snapshot. + snapshot(contents: any): void; // Assert that contents does not match regex. notRegex(contents: string, regex: RegExp, message?: string): void; // Assert that error is falsy. From d8777f36ccc5c582a59ecd2b849185c9f3d1b8a5 Mon Sep 17 00:00:00 2001 From: LasaleFamine Date: Wed, 8 Feb 2017 21:52:56 +0100 Subject: [PATCH 2/2] Added optional message --- index.js.flow | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js.flow b/index.js.flow index 2e70718d6..942e35395 100644 --- a/index.js.flow +++ b/index.js.flow @@ -69,7 +69,7 @@ type AssertContext = { // Assert that contents matches regex. regex(contents: string, regex: RegExp, message?: string): void; // Assert that contents matches a snapshot. - snapshot(contents: any): void; + snapshot(contents: any, message?: string): void; // Assert that contents does not match regex. notRegex(contents: string, regex: RegExp, message?: string): void; // Assert that error is falsy.