Skip to content

chore(vite): switch to vitest#9868

Merged
dac09 merged 6 commits intomainfrom
jgmw-chore/vite-vitest
Jan 22, 2024
Merged

chore(vite): switch to vitest#9868
dac09 merged 6 commits intomainfrom
jgmw-chore/vite-vitest

Conversation

@Josh-Walker-GM
Copy link
Copy Markdown
Contributor

The vite package used the node test runner. This PR switches it over to vitest.

The transition was not difficult.

  1. before and after for the node test runner have their vitest equivalents in beforeAll and afterAll. See: https://nodejs.org/api/test.html#afterfn-options where after is described as acting like afterAll.
  2. Usage of assert was not too difficult to transition as they could be switched to .toEqual and .not.toEqual
  3. Mocking of fs was achieved using spys and mockImplementationOnce. There was no clear need to use Once but it felt safer to assume that rather than continue to return the mock value for eternity.

@dac09 As requested I've switched this one out. One of the ts expect error comments is gone but one remains. From what I can see it seems to be a valid complaint - the type of PluginOption looks pretty funky.

@Josh-Walker-GM Josh-Walker-GM added the release:chore This PR is a chore (means nothing for users) label Jan 22, 2024
@Josh-Walker-GM Josh-Walker-GM added this to the chore milestone Jan 22, 2024
@Josh-Walker-GM Josh-Walker-GM requested a review from dac09 January 22, 2024 12:27
@Josh-Walker-GM Josh-Walker-GM self-assigned this Jan 22, 2024
@dac09
Copy link
Copy Markdown
Contributor

dac09 commented Jan 22, 2024

Thank you Joshhhhh!!! Will take a look and merge in a bit

@Tobbe
Copy link
Copy Markdown
Contributor

Tobbe commented Jan 22, 2024

I'll let you merge @dac09

@dac09 dac09 merged commit 1a1e758 into main Jan 22, 2024
@dac09 dac09 deleted the jgmw-chore/vite-vitest branch January 22, 2024 14:02
dac09 added a commit that referenced this pull request Jan 22, 2024
…e-scenario

* 'main' of github.com:redwoodjs/redwood:
  chore(vite): switch to vitest (#9868)
  chore: switch some more packages to vitest (#9867)
  chore(crwa): Fix/format code comment
@Josh-Walker-GM Josh-Walker-GM modified the milestones: chore, v8.0.0 Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

release:chore This PR is a chore (means nothing for users)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants