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

A .each throw type errors if going with a async method #1181

Closed
6 tasks done
bissolli opened this issue Apr 22, 2022 · 0 comments · Fixed by #1182
Closed
6 tasks done

A .each throw type errors if going with a async method #1181

bissolli opened this issue Apr 22, 2022 · 0 comments · Fixed by #1182

Comments

@bissolli
Copy link
Contributor

Describe the bug

A test.each using an async function will throw a TypeScript error if the ESLint rule @typescript-eslint/no-misused-promises is enabled.

The doesn't happen with a simple test.

image

Reproduction

https://stackblitz.com/edit/vitest-dev-vitest-tyuckt?file=src/basic.test.ts

Run npm run lint in the terminal and you will see the following output:

/home/projects/vitest-dev-vitest-tyuckt/src/basic.test.ts
  8:39  error  Promise returned in function argument where a void return was expected  @typescript-eslint/no-misused-promises

System Info

System:
    OS: macOS 11.6.2
    CPU: (8) x64 Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
    Memory: 97.65 MB / 16.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 16.14.0 - /usr/local/bin/node
    Yarn: 1.22.5 - /usr/local/bin/yarn
    npm: 8.3.1 - /usr/local/bin/npm
  Browsers:
    Brave Browser: 99.1.36.122
    Chrome: 100.0.4896.127
    Firefox: 88.0.1
    Safari: 14.1.2
  npmPackages:
    @vitejs/plugin-vue: ^2.2.2 => 2.3.1 
    vite: ^2.9.5 => 2.9.5 
    vitest: ^0.9.4 => 0.9.4

Used Package Manager

npm

Validations

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant