Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[jest-each] Fix test function type #8145

Merged
merged 3 commits into from Mar 18, 2019
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Expand Up @@ -6,6 +6,7 @@

### Fixes

- `[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
Expand Down
11 changes: 7 additions & 4 deletions packages/jest-each/src/index.ts
Expand Up @@ -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);
Expand All @@ -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);
Expand Down