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

fix: test.each type always return a callable function #10488

Merged
merged 9 commits into from Sep 13, 2020
Merged
Show file tree
Hide file tree
Changes from 4 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 @@ -3,6 +3,7 @@
### Features

- `[jest-circus, jest-config, jest-runtime]` Add new `injectGlobals` config and CLI option to disable injecting global variables into the runtime ([#10484](https://github.com/facebook/jest/pull/10484))
- `[jest-each]` Fixes `.each` type to always be callable ([#10447](https://github.com/facebook/jest/pull/10447))

### Fixes

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-jasmine2/src/jasmineAsyncInstall.ts
Expand Up @@ -192,7 +192,7 @@ function makeConcurrent(
return spec;
};
// each is binded after the function is made concurrent, so for now it is made noop
concurrentFn.each = () => {};
concurrentFn.each = () => () => {};
return concurrentFn;
}

Expand Down
2 changes: 1 addition & 1 deletion packages/jest-types/src/Global.ts
Expand Up @@ -45,7 +45,7 @@ type Each<EachCallback extends TestCallback> =
test: EachTestFn<EachCallback>,
timeout?: number,
) => void)
| (() => void);
| (() => () => void);

export interface ItBase {
(testName: TestName, fn: TestFn, timeout?: number): void;
Expand Down