#Testing vite plugins

1 messages · Page 1 of 1 (latest)

uncut harness
#

I’m creating a Vite plugin with a number of different virtual modules and code transformers. These behaviors are controlled by the plugin’s options. Using Vitest, what is the best way to test the various configurations of the plugin? It seems that since Vite is running Vitest there would be no way to spin up multiple instances of Vite for testing purposes? Thoughts on how this could be done?

empty crane
#

I'm not sure I understand. Why couldn't you use vitest in your plugin project?

uncut harness
#

I can. I want to test my vite plugin in multiple configurations. Is there some way to programmatically spin up Vite with a given set of plugins and fixtures? Each test of the plugin would require different vite configurations.

empty crane