[READ-ONLY] Mirror of https://github.com/vitest-dev/vitest. Next generation testing framework powered by Vite. vitest.dev
test testing-tools vite
12

Configure Feed

Select the types of activity you want to include in your feed.

docs: clarify placeholder usage (#10496)

authored by

Bonaventure C. J. Ugwu and committed by
GitHub
(Jun 2, 2026, 9:19 AM +0200) 7cb346c8 92d43587

+1 -1
+1 -1
docs/guide/learn/writing-tests.md
··· 176 176 }) 177 177 ``` 178 178 179 - The placeholders `%i`, `%s`, and `%f` in the test name are replaced with the corresponding values from each row, so the output shows `add(1, 1) -> 2`, `add(1, 2) -> 3`, and so on. 179 + In the example above, the %i placeholders are replaced with the integer values from each data row. Vitest also supports other placeholder types, such as %s for strings and %f for floating-point numbers. As a result, the test runner generates test names such as add(1, 1) -> 2, add(1, 2) -> 3, and add(2, 1) -> 3. 180 180 181 181 If your cases have more than two or three values, passing objects is more readable. Use `$property` in the name to interpolate fields: 182 182