-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
enhancementNew feature or requestNew feature or request
Description
Describe the bug
TypeErrors on vitest TestActions, e.g. beforeAll(), are unhelpful and merely state:
FAIL test.spec.ts > first
TypeError: fn is not a function
In the simple error below, it can be easily seen that someone has entered a text label into beforeAll() (which is common as other test suites allow this).
We would expect vsc to flag this up - however this cannot be relied up in big projects as red squiggles can sometimes take a long time to appear. (common issue with typescript is slow performance of the language server).
It would help debugging usages of vitest if we bubbled up why functions weren't able to be transpiled and called.
Reproduction
Reproduction found here
System Info
System:
OS: Linux 5.19 Ubuntu 22.04.2 LTS 22.04.2 LTS (Jammy Jellyfish)
CPU: (16) x64 Intel(R) Core(TM) i7-10700K CPU @ 3.80GHz
Memory: 18.45 GB / 46.85 GB
Container: Yes
Shell: 5.8.1 - /usr/bin/zsh
Binaries:
Node: 18.15.0 - ~/.nvm/versions/node/v18.15.0/bin/node
Yarn: 3.2.0 - ~/.yarn/bin/yarn
npm: 9.5.0 - ~/.nvm/versions/node/v18.15.0/bin/npm
Browsers:
Brave Browser: 111.1.49.120
Chrome: 111.0.5563.110
Firefox: 111.0.1
npmPackages:
vitest: ^0.29.7 => 0.29.7Used Package Manager
pnpm
Validations
- Follow our Code of Conduct
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request