Skip to main content
تشغيل أي مهارة في Manus
بنقرة واحدة

vitest-esm-class-mock

النجوم٢
التفرعات٠
آخر تحديث٧ أبريل ٢٠٢٦ في ٠٩:٥٧

How to mock class constructors (like WebClient from @slack/web-api) in vitest v4 with ESM modules. Trigger: tests fail with "mock is not being treated as a constructor" or `new ClassName()` returns undefined after vi.clearAllMocks(). Solves the problem of vi.fn().mockImplementation() losing its implementation across test lifecycle hooks.

التثبيت

التثبيت باستخدام Codex أو Claude انسخ هذا Prompt والصقه في Codex أو Claude أو مساعد آخر ليراجع صفحة Skill ويثبّتها لك.

SKILL.md
readonly