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.
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).
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.