googleapis/mocha-to-jest-migrator
Specialized guidance for migrating Node.js packages from the legacy Mocha, Sinon, and Istanbul/c8 ecosystem to Jest. It focuses on surgical test transformation, type safety, and resolving ESM/CommonJS interoperability issues.
npx skills add https://github.com/googleapis/google-cloud-node --skill mocha-to-jest-migrator
jest, ts-jest, and @types/jest.
experimental flags if possible by using mocking.
transform: { '^.+\\.tsx?$': ['ts-jest', { tsconfig: 'tsconfig.json' }] },
clearMocks: true
// Copyright 2026 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
any from the tests as you go.mock that dependency at the top level of the test file using jest.mock(). This bypasses the need for the
--experimental-vm-modules flag.
prevent tests from hanging on failure.
coverage/.Take googleapis/mocha-to-jest-migrator from the repository into ~/.claude/skills for personal
use, or into .claude/skills inside a project.
The agent identifies a skill by the name field in its header. Two skills with the
same name cannot sit side by side — one of them will be ignored.