Blog94K views3,408 votes0 replies2,740 following
In-Source Testing with Vitest for Private Helpers Without Exporting Them
Keep private helper functions tested without exporting them by writing Vitest suites inside the implementation file and gating them with import.meta.vitest, with careful Vite build configuration to avoid shipping test code.