Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Nov 7, 2025

Migrates the test infrastructure from Jest to Vitest, removing all Jest dependencies and configuration.

Changes

Dependencies

  • Removed: jest, @jest/globals, @types/jest, ts-jest, ts-jest-resolver, eslint-plugin-jest
  • Added: vitest, @vitest/ui, @vitest/coverage-v8

Configuration

  • Replaced jest.config.js with vitest.config.ts
  • Updated ESLint config to remove Jest-specific plugins and globals
  • Modified test scripts in package.json to use vitest run

Tests

  • Converted mocking from Jest's jest.unstable_mockModule() to Vitest's vi.mock()
  • Replaced fixture-based mocks with inline mock definitions
  • Removed outdated template tests (wait.test.ts) and __fixtures__ directory

Example migration:

// Before (Jest)
import { jest } from '@jest/globals'
import * as core from '../__fixtures__/core.js'
jest.unstable_mockModule('@actions/core', () => core)

// After (Vitest)
import { vi } from 'vitest'
const mockCore = { getInput: vi.fn(), setOutput: vi.fn() }
vi.mock('@actions/core', () => mockCore)

Documentation

  • Updated AGENTS.md and .github/prompts/unit-test.prompt.md to reflect Vitest usage

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • img.shields.io
    • Triggering command: node /home/REDACTED/work/gh-aw-mcp-container-action/gh-aw-mcp-container-action/node_modules/.bin/make-coverage-badge --output-path ./badges/coverage.svg (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Concert tests to vitest, remove jest.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Convert tests from Jest to Vitest Convert test suite from Jest to Vitest Nov 7, 2025
Copilot finished work on behalf of pelikhan November 7, 2025 07:03
Copilot AI requested a review from pelikhan November 7, 2025 07:03
@pelikhan pelikhan marked this pull request as ready for review November 7, 2025 07:06
@pelikhan pelikhan merged commit c9177bb into main Nov 7, 2025
15 of 23 checks passed
@pelikhan pelikhan deleted the copilot/convert-tests-to-vitest branch November 7, 2025 07:09
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.

2 participants