Skip to content

Commit

Permalink
Replace jest with vitest (#810)
Browse files Browse the repository at this point in the history
Signed-off-by: Marcel <MTRNord@users.noreply.github.com>
  • Loading branch information
MTRNord authored and HarHarLinks committed Oct 21, 2024
1 parent ab6abc5 commit 6299d5f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Testing support for `@matrix-widget-toolkit/api`.

When testing widgets that are using `@matrix-widget-toolkit/api` you quickly run
into the situation where you have to mock `WidgetApi`. While this can be done
using `jest`, this can be a lot of repeated work and you might miss edge cases
using `vitest`, this can be a lot of repeated work and you might miss edge cases
that makes the mock behave differently than the original. The package provides
a `mockWidgetApi` helper to cover this case. The returned mock can be used to
emulate a Widget host like Element, so that the widget can interact with the
Expand Down Expand Up @@ -62,7 +62,7 @@ const powerLevels = widgetApi.receiveSingleStateEvent('m.room.power_levels');

### Verifying Sending of Events

As the methods of the mock are using `jest.fn()`, you can verify all of them:
As the methods of the mock are using `vi.fn()`, you can verify all of them:

```typescript
// In your code, send an event:
Expand All @@ -82,7 +82,7 @@ expect(widgetApi.sendStateEvent).toBeCalledWith(

### Overriding Behavior

As the methods of the mock are using `jest.fn()`, you can change their default
As the methods of the mock are using `vi.fn()`, you can change their default
behavior by mocking them:

```typescript
Expand Down

0 comments on commit 6299d5f

Please sign in to comment.