Skip to content

KCD Migration (jest--> vitest): Migrate Jest to vitest and use native config instead of kcd-scripts i #405

Closed

Description

@lwasser

Migrate Jest config from kcd-scripts to native Jest configuration

Current state

The jest.config.js file currently extends kcd-scripts/jest:

const jestConfig = require('kcd-scripts/jest')

module.exports = Object.assign(jestConfig, {
  coverageThreshold: {
    global: {
      branches: 50,
      functions: 40,
      lines: 50,
      statements: 50,
    },
  },
  forceExit: true
})

Goal

Replace the kcd-scripts/jest dependency with a native Jest configuration
that maintains the same or similar functionality.

Tasks

  1. Research what configuration options kcd-scripts/jest provides (test
    environment, transform settings, module resolution, etc.)
  2. Create a native Jest configuration in jest.config.js that replicates
    the kcd-scripts behavior
  3. Ensure the existing custom configuration (coverage thresholds and
    forceExit) is preserved
  4. Verify all tests still pass with the new configuration
  5. Remove the dependency on kcd-scripts/jest from the config file

Did I miss anything?! (probably!)

Notes

Activity

  1. lwasser commented on Jan 25, 2026

    @lwasser
    MemberAuthor

    @JoshuaKGoldberg are you open to working on the JEST migration? I'll open other issues if you have a preference; if not, let's start here.

  2. changed the title [-]Migrate Jest config away from kcd-scripts in favor of native configuration[/-] [+]KCD Migration (jest): Migrate Jest config away from kcd-scripts in favor of native configuration[/+] on Jan 25, 2026
  3. JoshuaKGoldberg commented on Jan 27, 2026

    @JoshuaKGoldberg
    Contributor

    Sure, I can try it out. But I'll note that a lot of projects -including almost all of mine- have moved to Vitest. Vitest is more actively maintained and IME works a lot more smoothly than Jest these days. I've had a lot of pain trying to get Jest to work on modern Node.js - then found it easier to just switch to Vitest most of the time. If this ends up being a big pain too, would you be open to that?

  4. lwasser commented on Jan 29, 2026

    @lwasser
    MemberAuthor

    @JoshuaKGoldberg i trust your judgement here as I am also learning here (from you!) and others. I don't have opinions about node tooling yet but I do know that fighting with older tooling is not worth it!

    If you think vitest is better / and it's more actively maintained, we should move. I also did a quick search on it and it sounds like vitest is easier to configure and maybe faster? So i'm all for that.

    Now is the perfect time to migrate given so many things are already broken anyway. So let's migrate!

  5. changed the title [-]KCD Migration (jest): Migrate Jest config away from kcd-scripts in favor of native configuration[/-] [+]KCD Migration (jest--> vitest): Migrate Jest to vitest and use native config instead of kcd-scripts i[/+] on Jan 29, 2026
  6. lwasser commented on Jan 29, 2026

    @lwasser
    MemberAuthor

    I updated the issue title!!

  7. JoshuaKGoldberg commented on Jan 30, 2026

    @JoshuaKGoldberg
    Contributor

    Sweet! I'm still projecting to be able to get to this next week. 🚀

  8. lwasser commented on Jan 31, 2026

    @lwasser
    MemberAuthor

    Wonderful. Thank you!!

  9. JoshuaKGoldberg commented on Jan 31, 2026

    @JoshuaKGoldberg
    Contributor

    Nice-to-have: I'd like to treat this as blocked on #404. That way it'll be easier to switch from eslint-plugin-jest to @vitest/eslint-plugin.

  10. lwasser commented on Jan 31, 2026

    @lwasser
    MemberAuthor

    Absolutely! 404 is merged now, so please update away!! It's so tricky to scope PRs now because one pr affects the other, with so many changes and updates to make! 🙃

  11. lwasser commented on Feb 13, 2026

    @lwasser
    MemberAuthor

    closed via #436

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions