Skip to content

Conversation

@nameless-mc
Copy link
Contributor

Why

Migrating from Jest to Vitest provides the following benefits:

Faster test execution without Babel transpilation
Simplified configuration with native ESM support
Native TypeScript support

What

  • Migrated test runner from Jest to Vitest across all packages
    • plugin-manifest-validator
    • profile-loader
    • customize-uploader
    • webpack-plugin-kintone-plugin
    • dts-gen
    • plugin-packer
    • create-plugin
    • rest-api-client
    • root (workspace-wide)
  • Removed jest.config.js and added vitest.config.ts for each package
  • Replaced Jest-specific APIs with Vitest equivalents in test files
    • jest.fn()vi.fn()
    • jest.mock()vi.mock()
    • jest.spyOn()vi.spyOn()
    • jest.clearAllMocks()vi.clearAllMocks() etc.
  • Enabled vitest globals and removed import statements from test files
  • Added tsconfig.test.json to each package for improved IDE type recognition of vitest globals
  • Added eslint-plugin-vitest for enhanced test code linting
  • Consolidated vitest package to root (removed from individual packages for hoisting)

How to test

Checklist

  • Read CONTRIBUTING.md
  • Updated documentation if it is required.
  • Added tests if it is required.
  • Passed pnpm lint and pnpm test on the root directory.

@nameless-mc nameless-mc self-assigned this Dec 24, 2025
Copilot AI review requested due to automatic review settings December 24, 2025 09:11
@nameless-mc nameless-mc requested a review from a team as a code owner December 24, 2025 09:11
@nameless-mc nameless-mc requested review from chihiro-adachi and shabaraba and removed request for a team December 24, 2025 09:11
@github-actions github-actions bot added pkg: rest-api-client @kintone/rest-api-client pkg: customize-uploader @kintone/customize-uploader pkg: plugin-manifest-validator @kintone/plugin-manifest-validator pkg: dts-gen @kintone/dts-gen pkg: create-plugin @kintone/create-plugin pkg: plugin-packer @kintone/plugin-packer pkg: webpack-plugin-kintone-plugin @kintone/webpack-plugin-kintone-plugin pkg: profile-loader @kintone/profile-loader labels Dec 24, 2025
Copy link
Contributor

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 PR migrates the test infrastructure from Jest to Vitest across all packages in the monorepo. The migration brings improved performance through native ESM support and eliminates the need for Babel transpilation, while maintaining feature parity with the Jest-based tests.

Key Changes

  • Replaced Jest with Vitest as the test runner across 9 packages (plugin-manifest-validator, profile-loader, customize-uploader, webpack-plugin-kintone-plugin, dts-gen, plugin-packer, create-plugin, rest-api-client, and root workspace)
  • Added vitest.config.ts files for each package with appropriate test configurations
  • Migrated test API calls from Jest to Vitest equivalents (jest.fn()vi.fn(), jest.mock()vi.mock(), etc.)
  • Introduced tsconfig.test.json files in each package for better TypeScript integration with Vitest globals
  • Consolidated vitest as a root dependency (removed from individual packages for hoisting)
  • Added eslint-plugin-vitest for enhanced test code linting

Reviewed changes

Copilot reviewed 69 out of 72 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
vitest.config.ts (root) Root-level Vitest configuration
tsconfig.test.json (root) TypeScript configuration for test files
tsconfig.json (root) Updated to exclude test files and reference test config
pnpm-lock.yaml Dependency changes: removed Jest packages, added Vitest and related packages
packages/*/vitest.config.ts Package-specific Vitest configurations
packages/*/tsconfig.test.json Package-specific TypeScript test configurations
packages/*/tsconfig.json Updated to exclude test files and add test config references
packages/*/package.json Updated test scripts from Jest to Vitest
packages//**/.test.ts Updated test files with Vitest API equivalents
packages/*/jest.config.js Removed Jest configuration files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@nameless-mc nameless-mc force-pushed the test/migrate-jest-to-vitest branch from 52a6636 to 663382b Compare December 25, 2025 01:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pkg: create-plugin @kintone/create-plugin pkg: customize-uploader @kintone/customize-uploader pkg: dts-gen @kintone/dts-gen pkg: plugin-manifest-validator @kintone/plugin-manifest-validator pkg: plugin-packer @kintone/plugin-packer pkg: profile-loader @kintone/profile-loader pkg: rest-api-client @kintone/rest-api-client pkg: webpack-plugin-kintone-plugin @kintone/webpack-plugin-kintone-plugin

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants