Skip to content

Commit

Permalink
[jest-each] Fix test function type (#8145)
Browse files Browse the repository at this point in the history
* Fix jest each test function type

* Add changelog entry

* Fix missing parens in changelog
  • Loading branch information
mattphillips authored and SimenB committed Mar 18, 2019
1 parent 0100877 commit 30cb244
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
11 changes: 7 additions & 4 deletions packages/jest-each/src/index.ts
Original file line number Diff line number Diff line change
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

0 comments on commit 30cb244

Please sign in to comment.