At Formbricks, we maintain a rigorous testing strategy to ensure high-quality code and reliable functionality. Our testing approach is standardized and integrated into our development workflow.
We use Vitest as our primary testing framework. All unit tests follow these conventions:
File Location and Naming
Test files are co-located with the source files they test
Test files use the .test.ts extension (e.g., utils.test.ts tests utils.ts)
Test Organization
Copy
Ask AI
import { describe, expect, test } from "vitest";describe("ComponentName or FeatureName", () => { describe("functionName or scenario", () => { // We use the `test` function instead of `it` throught our test suite test("should describe expected behavior", () => { // test implementation }); });});