vitest icon indicating copy to clipboard operation
vitest copied to clipboard

Type `Promisify<...>` has no call signatures

Open mwstr opened this issue 3 years ago • 3 comments

Describe the bug

I'm trying to reproduce resolves example. The Chai style assertion throws strange Typescript error: image

Reproduction

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

System Info

System:
    OS: Linux 6.1 Fedora Linux 37 (Workstation Edition)
    CPU: (16) x64 Intel(R) Core(TM) i7-10700 CPU @ 2.90GHz
    Memory: 5.08 GB / 15.46 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 18.0.0 - ~/.volta/tools/image/node/18.0.0/bin/node
    npm: 8.6.0 - ~/.volta/tools/image/node/18.0.0/bin/npm
  Browsers:
    Chrome: 110.0.5481.77
  npmPackages:
    vite: ^4.1.1 => 4.1.1 
    vitest: ^0.28.5 => 0.28.5

Used Package Manager

pnpm

Validations

mwstr avatar Feb 14 '23 09:02 mwstr

This appears to still be a problem and it is quite annoying because it makes using the Chai API with promises very inconvenient in TypeScript projects.

FeldrinH avatar Aug 16 '23 16:08 FeldrinH

Together with https://github.com/vitest-dev/vitest/issues/3941 this seems to leave no good options for asserting errors thrown in async functions if you are using TypeScript.

FeldrinH avatar Aug 16 '23 16:08 FeldrinH

This is still an issue in the latest version of Vitest.

hanneswidrig avatar Feb 16 '24 14:02 hanneswidrig