Skip to content

Commit

Permalink
🔨 [#724] Swap out Jest for Vitest
Browse files Browse the repository at this point in the history
Set up a vite config and vitest configuration to transform our code
and setup into something that compiles and passes the tests. Create
React App is dead and the official React docs recommend using a
framework like Next.js/Redux or a toolchain like Vite when building
a low level library.

We start with migrating the test suite to the Vite ecosystem before
touching the bundler itself. This way we get most of the hiccups out
of the way, while (hopefully) minimizing impact on actual production
artifacts.

Jest configuration has been removed from package.json. It's currently
still used under the hood by storybook, but that too will be migrated
in due time.

We're sticking with jsdom for the time being - Vitest can run tests in
a real browser, but it's still marked as experimental and we don't
appear to be running into the same issues for MSW as we did with jest,
which required a workaround by using a fixed jsdom environment.
  • Loading branch information
sergei-maertens committed Nov 26, 2024
1 parent 4147c6f commit 90ebe7f
Show file tree
Hide file tree
Showing 5 changed files with 2,179 additions and 723 deletions.
7 changes: 0 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
tests:
name: Run Javascript tests
runs-on: ubuntu-latest
needs: build

steps:
- uses: actions/checkout@v4
Expand All @@ -78,12 +77,6 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: sdk-build
path: dist/

- name: Run tests
run: |
npm test -- --coverage
Expand Down
Loading

0 comments on commit 90ebe7f

Please sign in to comment.