diff --git a/tests/README.md b/tests/README.md index baa92fed..12a1e7ff 100644 --- a/tests/README.md +++ b/tests/README.md @@ -1,6 +1,7 @@ # Tests -Uses vitest as test runner. +Feliz uses vitest as test runner. + ## Run tests @@ -17,7 +18,34 @@ npm run test ``` or in watch mode: - ```bash npm run test:watch ``` + +## Run specific tests + +### Use `f`ocused tests + +You can find a helper function binding to vitest `only` test in tests/Globals: + +```fsharp +let inline ftestPromise (name: string) (fn: unit -> Fable.Core.JS.Promise) = Vitest.Test.only(name, fn) +``` + +If you use `ftestPromise` only this test will be run, and you can adjust the focused tests during watch mode. + +### Use vitest test filtering + +To run a specific test file(s); in either **project root** or **test project root** add the filename (partial match) you want to run: + +For example, appending memo will check all files containing `memo`, see Vitest docs: + + +```bash +npm run test memo +``` + +or in watch mode (only in test project root): +```bash +npm run test:watch memo +```