In-Source Testing Vitest also provides a way to run tests within your source code along side the implementation, similar to Rust's module tests. This makes the tests share the same closure as the implementations and able to test against private states without exporting. Meanwhile, it also brings a closer feedback loop for development. Setup To get started, put a if (import.meta.vitest) block at