Skip to content

Migrate from jest to vitest #2085

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed

Migrate from jest to vitest #2085

wants to merge 3 commits into from

Conversation

jdeniau
Copy link
Member

@jdeniau jdeniau commented Mar 27, 2025

Now that jest-jasmine has been removed, let's migrate from jest to vitest.

Why ?

  • Because jest seems to be moving really slowly now (jest 29 is two years old, first alpha of 30 is 1.5 year old). Even if there is a recent alpha of 30, we don't know if it will resolve all pain of jest configuration.
  • Because we do bundle immutable with rollup, and vitest does use rollup too, so the configuration is pretty straightforward, and we can remove a lot of hack.

@jdeniau jdeniau requested a review from Copilot March 27, 2025 23:23
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request migrates the test suite from using Jest to using Vitest, updating the test imports and relevant API calls accordingly.

  • Replace Jest-specific functions (e.g., jest.fn(), jest.resetModules(), jest.requireActual) with their Vitest equivalents.
  • Update assertions to use Vitest’s syntax where applicable.

Reviewed Changes

Copilot reviewed 63 out of 63 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/Set.ts Updated import and replaced jest.fn() with vi.fn()
tests/Seq.ts Added Vitest imports
tests/Repeat.ts Added Vitest imports
tests/RecordJS.js Updated Vitest syntax for module reset and instance checks
tests/Record.ts Updated equality assertion with Vitest expectations
tests/Range.ts Added Vitest imports
tests/Predicates.ts Added Vitest imports
tests/OrderedSet.ts Added Vitest imports
tests/OrderedMap.ts Added Vitest imports
tests/ObjectSeq.ts Added Vitest imports
tests/MultiRequire.js Replaced Jest functions and updated to use async importActual
tests/Map.ts Updated Vitest imports and replaced jest.fn()
tests/ListJS.js Added Vitest imports
tests/List.ts Added Vitest imports
tests/KeyedSeq.ts Fixed a redundant wording and added Vitest imports
tests/IndexedSeq.ts Added Vitest imports
tests/Equality.ts Added Vitest imports
tests/Conversion.ts Added Vitest imports
tests/Comparator.ts Added Vitest imports
tests/ArraySeq.ts Added Vitest imports

@jdeniau
Copy link
Member Author

jdeniau commented Mar 28, 2025

Superseeded by #2087

@jdeniau jdeniau closed this Mar 28, 2025
@jdeniau jdeniau deleted the jest-to-vitest branch March 28, 2025 22:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant