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] broken TS types #8144

Closed
jgarces-tw opened this issue Mar 18, 2019 · 1 comment · Fixed by #8145
Closed

[jest-each] broken TS types #8144

jgarces-tw opened this issue Mar 18, 2019 · 1 comment · Fixed by #8145

Comments

@jgarces-tw
Copy link

🐛 Bug Report

jest-each ts typings for "test" function seems to be broken, since the test function accepts a testFn function with a single argument (done?), while it should be many arguments (one per each entry of each test suite)

from the jest-each/build/index.d.ts

describe: {
  // I think this suite param should be Global.EAchTestFn like in skip and only (which work)
            (title: string, suite: Global.TestFn, timeout?: number | undefined): void;
            skip: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void;
            only: (title: string, test: Global.EachTestFn, timeout?: number | undefined) => void;
        };

To Reproduce

Steps to reproduce the behavior:

const suite = [["a", "b"]];

each(suite).test( // test only and skip is ok though 
    "whatever",
    (a: string, b: string) => { });

Expected behavior

It should compile

Link to repl or repo (highly encouraged)

Please provide either a repl.it demo or a minimal repository on GitHub.

Issues without a reproduction link are likely to stall.

Run npx envinfo --preset jest

Paste the results here:

24.5.0 (same package number for jest-each)
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Please note this issue tracker is not a help forum. We recommend using StackOverflow or our discord channel for questions.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant