From 30cb244e4413cd171bab6395f02855ac9d1b6b59 Mon Sep 17 00:00:00 2001 From: Matt Phillips Date: Mon, 18 Mar 2019 14:43:51 +0000 Subject: [PATCH] [jest-each] Fix test function type (#8145) * Fix jest each test function type * Add changelog entry * Fix missing parens in changelog --- CHANGELOG.md | 9 +++++---- packages/jest-each/src/index.ts | 11 +++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1718e470eb1..6ac0a2922359 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,14 +6,15 @@ ### Fixes -- `[pretty-format]` Print `BigInt` as a readable number instead of `{}` [#8138](https://github.com/facebook/jest/pull/8138) +- `[jest-each]` Fix test function type ([#8145](https://github.com/facebook/jest/pull/8145)) +- `[pretty-format]` Print `BigInt` as a readable number instead of `{}` ([#8138](https://github.com/facebook/jest/pull/8138)) ### Chore & Maintenance - `[*]` Remove flow from code base ([#8061](https://github.com/facebook/jest/pull/8061)) -- `[*]` Use property initializer syntax in Jest codebase [#8117](https://github.com/facebook/jest/pull/8117) -- `[docs]` Improve description of optional arguments in ExpectAPI.md [#8126](https://github.com/facebook/jest/pull/8126) -- `[*]` Move @types/node to the root package.json [#8129](https://github.com/facebook/jest/pull/8129) +- `[*]` Use property initializer syntax in Jest codebase ([#8117](https://github.com/facebook/jest/pull/8117)) +- `[docs]` Improve description of optional arguments in ExpectAPI.md ([#8126](https://github.com/facebook/jest/pull/8126) +- `[*]` Move @types/node to the root package.json [#8129](https://github.com/facebook/jest/pull/8129)) ### Performance diff --git a/packages/jest-each/src/index.ts b/packages/jest-each/src/index.ts index 82b04f4a5737..4ee273bbb596 100644 --- a/packages/jest-each/src/index.ts +++ b/packages/jest-each/src/index.ts @@ -16,12 +16,12 @@ const install = ( table: Global.EachTable, ...data: Global.TemplateData ) => { - const test = (title: string, test: Global.TestFn, timeout?: number) => + const test = (title: string, test: Global.EachTestFn, timeout?: number) => bind(g.test)(table, ...data)(title, test, timeout); test.skip = bind(g.test.skip)(table, ...data); test.only = bind(g.test.only)(table, ...data); - const it = (title: string, test: Global.TestFn, timeout?: number) => + const it = (title: string, test: Global.EachTestFn, timeout?: number) => bind(g.it)(table, ...data)(title, test, timeout); it.skip = bind(g.it.skip)(table, ...data); it.only = bind(g.it.only)(table, ...data); @@ -30,8 +30,11 @@ const install = ( const fit = bind(g.fit)(table, ...data); const xtest = bind(g.xtest)(table, ...data); - const describe = (title: string, suite: Global.TestFn, timeout?: number) => - bind(g.describe, false)(table, ...data)(title, suite, timeout); + const describe = ( + title: string, + suite: Global.EachTestFn, + timeout?: number, + ) => bind(g.describe, false)(table, ...data)(title, suite, timeout); describe.skip = bind(g.describe.skip, false)(table, ...data); describe.only = bind(g.describe.only, false)(table, ...data); const fdescribe = bind(g.fdescribe, false)(table, ...data);