javascript-typescript-jest by github/awesome-copilot
npx skills add https://github.com/github/awesome-copilot --skill javascript-typescript-jest.test.ts 或 .test.js 后缀命名__tests__ 目录中describe 块来组织相关的测试describe('组件/函数/类', () => { it('应该做某事', () => {}) })jest.mock() 进行模块级模拟jest.spyOn() 进行特定函数模拟mockImplementation() 或 来定义模拟行为广告位招租
在这里展示您的产品或服务
触达数万 AI 开发者,精准高效
mockReturnValue()afterEach 中使用 jest.resetAllMocks() 在测试之间重置模拟resolves/rejects 匹配器jest.setTimeout() 为慢速测试设置适当的超时时间userEvent 而非 fireEvent 以获得更真实的用户交互expect(value).toBe(expected), expect(value).toEqual(expected)expect(value).toBeTruthy(), expect(value).toBeFalsy()expect(value).toBeGreaterThan(3), expect(value).toBeLessThanOrEqual(3)expect(value).toMatch(/pattern/), expect(value).toContain('substring')expect(array).toContain(item), expect(array).toHaveLength(3)expect(object).toHaveProperty('key', value)expect(fn).toThrow(), expect(fn).toThrow(Error)expect(mockFn).toHaveBeenCalled(), expect(mockFn).toHaveBeenCalledWith(arg1, arg2)每周安装量
8.1K
代码仓库
GitHub 星标数
26.9K
首次出现
2026年2月25日
安全审计
安装于
codex7.9K
gemini-cli7.9K
opencode7.9K
cursor7.9K
github-copilot7.9K
kimi-cli7.9K
.test.ts or .test.js suffix__tests__ directorydescribe('Component/Function/Class', () => { it('should do something', () => {}) })jest.mock() for module-level mocksjest.spyOn() for specific function mocksmockImplementation() or mockReturnValue() to define mock behaviorjest.resetAllMocks() in afterEachresolves/rejects matchers for promisesjest.setTimeout()userEvent over fireEvent for more realistic user interactionsexpect(value).toBe(expected), expect(value).toEqual(expected)expect(value).toBeTruthy(), expect(value).toBeFalsy()expect(value).toBeGreaterThan(3), expect(value).toBeLessThanOrEqual(3)expect(value).toMatch(/pattern/), expect(value).toContain('substring')expect(array).toContain(item), expect(array).toHaveLength(3)Weekly Installs
8.1K
Repository
GitHub Stars
26.9K
First Seen
Feb 25, 2026
Security Audits
Gen Agent Trust HubPassSocketPassSnykPass
Installed on
codex7.9K
gemini-cli7.9K
opencode7.9K
cursor7.9K
github-copilot7.9K
kimi-cli7.9K
React 组合模式指南:Vercel 组件架构最佳实践,提升代码可维护性
102,200 周安装
AI智能体长期记忆系统 - 精英级架构,融合6种方法,永不丢失上下文
1,200 周安装
AI新闻播客制作技能:实时新闻转对话式播客脚本与音频生成
1,200 周安装
Word文档处理器:DOCX创建、编辑、分析与修订痕迹处理全指南 | 自动化办公解决方案
1,200 周安装
React Router 框架模式指南:全栈开发、文件路由、数据加载与渲染策略
1,200 周安装
Nano Banana AI 图像生成工具:使用 Gemini 3 Pro 生成与编辑高分辨率图像
1,200 周安装
SVG Logo Designer - AI 驱动的专业矢量标识设计工具,生成可缩放品牌标识
1,200 周安装
expect(object).toHaveProperty('key', value)expect(fn).toThrow(), expect(fn).toThrow(Error)expect(mockFn).toHaveBeenCalled(), expect(mockFn).toHaveBeenCalledWith(arg1, arg2)