-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Introduction to React Testing: Import Vitest functions #28253
Comments
MaoShizhong
added
the
Status: Help Wanted
This issue can be assigned to other contributors
label
Jun 21, 2024
Coincidentally, this was the exact lesson I was going through today :D |
MaoShizhong
removed
the
Status: Help Wanted
This issue can be assigned to other contributors
label
Jun 21, 2024
Go for it - assigned |
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checks
Describe your suggestion
Description
A previous open PR for this fell through, so re-opening an issue for someone to be assigned.
In the Introduction to React Testing lesson, our code examples of tests use Vitest's globals, due to the setup guide including
globals: true
invite.config.js
.While this allows the tests to work without errors when running Vitest, ESLint (which comes by default) will still complain about undefined variables. The fix for this is iffy, as ESLint doesn't have Vitest globals built in as an environment, meaning you'd have to enable the Jest environment then manually add individual Vitest-specific globals. This is a lot of faff learners face, just to use Vitest globals. A better resolution would be to just import the Vitest functions needed. No ESLint shenanigans, you don't have to mess with globals and you get better intellisense for those functions anyway, as they won't be typed as
any
.Please comment below if you'd like to be assigned to work on this issue. Please do not start any work until you have been formally assigned by a maintainer.
Acceptance criteria
describe
,expect
orit
will need to have them imported in the code block.Path
Ruby / Rails, Node / JS
Lesson Url
https://www.theodinproject.com/lessons/node-path-react-new-introduction-to-react-testing#our-first-query
(Optional) Discord Name
No response
(Optional) Additional Comments
No response
The text was updated successfully, but these errors were encountered: