Vite is fixing this in v6.1 according to this pull request
Until then, setting node options to '--import tsx' will work.
> NODE_OPTIONS='--import tsx' vitest
> NODE_OPTIONS='--loader tsx' vitest