Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions tests/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# Tests

Uses vitest as test runner.
Feliz uses vitest as test runner.


## Run tests

Expand All @@ -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<unit>) = 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: <https://vitest.dev/guide/filtering>


```bash
npm run test memo
```

or in watch mode (only in test project root):
```bash
npm run test:watch memo
```