testing-library / vue-testing-library

🦎 Simple and complete Vue.js testing utilities that encourage good testing practices.
http://testing-library.com/vue
MIT License
1.06k stars 110 forks source link

8.0.0 makes it impossible to run with vitest and no global afterEach #308

Closed kalvenschraut closed 7 months ago

kalvenschraut commented 8 months ago

It is impossible to skip this line of code due to incorrect logic. If afterEach is not defined globally, if statement is false then you will ALWAYS hit the else if check if using vitest irrelevant if you set VTL_SKIP_AUTO_CLEANUP to true.

VTL_SKIP_AUTO_CLEANUP should be moved to the else if and only enter it if not set to a true value.

afontcu commented 7 months ago

If I understand you correctly (the file linked changed, so I'm not 100% sure what line you were talking about), this was addressed in v8.0.1 as we no longer throw on using VTL wihtout globals (eg when using vitest).