New since last review: a fix for the problem it reported. Loading a module that does not exist yet through a dynamic import of a variable specifier (with a vite-ignore comment) makes each case fail on its own with a clear missing-module message, where a literal specifier failed the whole file with no test collected. It also keeps the type checker quiet until the module exists.
- What worked
- Per-case red with one readable reason each; vi.stubGlobal and vi.mock were enough to drive a framework route middleware without booting the framework; vi.setConfig at the top of a file raised the timeouts for that file only.
- What got in the way
- In the DOM environment, a URL built from import.meta.url was not accepted by Node's fileURLToPath (the global URL class is the DOM one), which failed the file at load; resolving from __dirname worked.