Open andreatiled opened 2 months ago
The reason of calling location.reload() is to ensure that after all tests in the file ran, the next tests will execute in a clean environment as if we just loaded the page
What do you mean? Vitest tests run in isolated environments.
So, it looks like this can only happen if the reload happens in the last test because we remove previous iframes. This also happens outside of Vitest's test lifecycle because onFinished
was already called and we reported all test results. The reporter still prints test results after "FAIL"/"SUCCESS" footer, but we don't have any mechanism to report behaviour that happens after onFinished
is called. I wonder if this should be resolved with the new reporter API.
Describe the bug
As the title describes, i'm using Vitest in browser mode and i'm calling
location.reload()
inafterAll
callback:The reason of calling
location.reload()
is to ensure that after all tests in the file ran, the next tests will execute in a clean environment as if we just loaded the pageReproduction
Can't seem to get StackBlitz work with Vitest in browser mode
System Info
Used Package Manager
npm
Validations