From 1cc1bd5331cfeb3695736f1f7ab22de11f58312b Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 15 Oct 2018 22:08:14 +0700 Subject: [PATCH] Minor tweaks to the Flow and TS recipe --- docs/recipes/flow.md | 6 ++++-- docs/recipes/typescript.md | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/docs/recipes/flow.md b/docs/recipes/flow.md index f94bf7e7f..d729182c9 100644 --- a/docs/recipes/flow.md +++ b/docs/recipes/flow.md @@ -15,7 +15,9 @@ We recommend you use AVA's built-in Babel pipeline to strip Flow type annotation "ava": { "babel": { "testOptions": { - "plugins": ["@babel/plugin-transform-flow-strip-types"] + "plugins": [ + "@babel/plugin-transform-flow-strip-types" + ] } } } @@ -87,7 +89,7 @@ class CustomError extends Error { } function myFunc() { - throw new CustomError(TypeError('🙈')); + throw new CustomError(new TypeError('🙈')); }; test('throws', t => { diff --git a/docs/recipes/typescript.md b/docs/recipes/typescript.md index 5c94749b2..29a1a283f 100644 --- a/docs/recipes/typescript.md +++ b/docs/recipes/typescript.md @@ -51,7 +51,7 @@ import test from 'ava'; const fn = async () => Promise.resolve('foo'); -test(async (t) => { +test(async t => { t.is(await fn(), 'foo'); }); ``` @@ -153,7 +153,7 @@ class CustomError extends Error { } function myFunc() { - throw new CustomError(TypeError('🙈')); + throw new CustomError(new TypeError('🙈')); }; test('throws', t => {