GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: migrate tests from Jest to Vitest by JoshuaKGoldberg · Pull Request #436 · all-contributors/cli

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Feb 10, 2026 •
edited by lwasser
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

closes #406
Switches from the old Jest config, which extended kcd-scripts/jest, to Vitest.

This was a little more involved than I'd first thought (hence this PR coming a week later than I expected). At first I tried a manual switch-over but got into a confusing state where imports weren't being properly mocked out with vi.mock. I then restarted with Copilot and used Research-Plan-Implement. Copilot nailed it in one go, with just a little docs & scripts cleanup needed on my end (I manually reviewed every file).

The only major behavioral difference in tests is that nock is now used in src/repo/__tests__/index.js instead of internal mocking of modules. The new tests keep the functions as asynchronous, whereas the old ones switched them to synchronous for testing (weird!). I actually like this as more of an end-to-end / comprehensive test, rather than specifically looking at implementation details of what that file imports.

I think we can ignore the failing coverage indirect changes check. If you look at the indirect changes in Codecov they're mostly on comment lines.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jdalrymple reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@JoshuaKGoldberg
JoshuaKGoldberg force-pushed the jest-to-vitest branch from 42bd501 to f9f7d16 Compare February 10, 2026 15:10
@JoshuaKGoldberg
JoshuaKGoldberg marked this pull request as ready for review February 10, 2026 15:16
JimMadge
JimMadge approved these changes Feb 11, 2026
View reviewed changes

@JimMadge JimMadge left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Looks good. I think the loss of coverage through indirect changes is just the cost of switching test frameworks. We can start focusing on maintaining/increasing coverage after we have this sorted.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JoshuaKGoldberg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
lwasser
lwasser reviewed Feb 12, 2026
View reviewed changes
Comment thread src/init/__tests__/__snapshots__/add-contributors-list.js.snap
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`addContributorsList create contributors section if content is empty 1`] = `
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html

@lwasser lwasser Feb 12, 2026

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@JoshuaKGoldberg thank you for this. i'm gonna approve but it just needs a quick rebase before we can merge!

i have one question about these snapshots. Do they get updated when we run the tests suite or do we need to update them separately? i'm familiar with casettes in Python, which seem similar BUT when i've used them we had to update them occasionally separately.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@JoshuaKGoldberg JoshuaKGoldberg Feb 12, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Good question: they can be updated automatically, but only if you explicitly provide the -u / --update CLI option (https://vitest.dev/guide/cli.html#update).

  • Without -u: if snapshots mismatch, tests fail and print the diff
  • With -u: snapshots are updated for you automatically

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
lwasser
lwasser approved these changes Feb 12, 2026
View reviewed changes

@lwasser lwasser left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

@JoshuaKGoldberg can merge this after you rebase the pr - there is a merge conflict! Thank you so much for all of this work!! i'm excited that we are modernizing the code base as we go too!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JoshuaKGoldberg reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
@JoshuaKGoldberg
chore: migrate tests from Jest to Vitest
c15abe9
@JoshuaKGoldberg
JoshuaKGoldberg force-pushed the jest-to-vitest branch from f9f7d16 to c15abe9 Compare February 12, 2026 13:47
@JoshuaKGoldberg
Removed jest.config.js from knip.json
4d1de84
@JoshuaKGoldberg
JoshuaKGoldberg merged commit ba555a8 into all-contributors:main Feb 12, 2026
4 of 5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@JoshuaKGoldberg JoshuaKGoldberg mentioned this pull request Feb 13, 2026
🛠️ Tooling: Switch from CJS to ESM #435
Closed
This was referenced Feb 13, 2026
KCD Migration (tests): migrate tests step away from kcd to native configuration #406
Closed
KCD Migration (jest--> vitest): Migrate Jest to vitest and use native config instead of kcd-scripts i #405
Closed
This was referenced Mar 6, 2026
chore(main): release all-contributors-cli 7.0.0 #476
Closed
chore(main): release 6.27.0 #483
Closed
This was referenced Oct 23, 2026
chore(main): release 6.27.0 #581
Closed
chore(release): release 7.0.0 #583
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@lwasser lwasser lwasser approved these changes
@JimMadge JimMadge JimMadge approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

KCD Migration (tests): migrate tests step away from kcd to native configuration

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@JoshuaKGoldberg @lwasser @JimMadge
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.