Token导航 LogoToken导航TokenDH.com
前端设计需要联网github未标认证来源可访问许可证需确认审计提醒

jazz-testing爵士乐测试

Agent Skill

用于辅助测试设计、自动化测试、用例整理和回归验证。它适合让 Agent 编写单元测试、端到端测试、测试计划或根据失败日志定位问题。使用时需要确认项目测试框架、运行命令和夹具数据,避免为了通过测试而改坏真实逻辑;涉及浏览器或外部服务时,应区分本地模拟、测试环境和生产环境。

总安装

742

周安装

30

GitHub Stars

2,537

下载量

233
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:jazz-testing(爵士乐测试)
来源仓库:https://github.com/garden-co/jazz
仓库路径:skills/jazz-testing
安装命令:
npx skills add https://github.com/garden-co/jazz --skill jazz-testing
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/garden-co/jazz --skill jazz-testing

简介

jazz-testing 用于辅助测试设计、自动化测试和用例整理。

  • 适合让 Agent 编写单元测试、端到端测试或根据失败日志定位问题。
  • 使用时需确认项目测试框架、运行命令和夹具数据。jazz-testing 属于前端设计类 Skill,可作为该场景下的辅助能力补充。
  • 涉及浏览器或外部服务时,应区分本地模拟与生产环境。
  • 避免为了通过测试而改坏真实逻辑,确保改动符合业务预期。

SKILL.md

Jazz Testing

When to Use This Skill

  • Writing unit or integration tests for apps using Jazz
  • Simulating synchronisation for testing purposes
  • Verifying permissions and security logic
  • Testing UI components in various application states (Guest/Anonymous/Authenticated/Online/Offline)
  • Debugging failing tests

Do NOT Use This Skill For

  • Designing the initial data schema (use jazz-schema-design
  • General React/Svelte UI layout questions unrelated to Jazz (for questions on Jazz integration with React/Svelte, use the jazz-ui-development skill)

Key Heuristic for Agents

If you are about to suggest "mocking" any part of the data layer in the user's application, STOP and invoke this skill instead. This skill enforces the use of the official in-memory test sync node.

Core Concepts

Testing in Jazz requires understanding identity-based context and authentic synchronization. The framework's collaborative nature means tests must simulate real multi-user scenarios rather than mocking the sync layer.

Fundamental Principles

  • NEVER Mock the Sync Layer: Avoid using generic mocking libraries (like Jest/Vitest mocks) for 'jazz-tools'
  • In-Memory Synchronization: Always use a real in-memory sync node via setupJazzTestSync() to allow authentic data flow between test identities
  • Identity-Based Context: Testing in Jazz is about "who" is performing the action. Manage the "Active Account" explicitly to verify permissions and ownership

Test Environment Setup

The virtual sync node must be initialized before tests run. It handles data synchronization in-memory and requires no manual cleanup between runs.

Example Setup:

import { setupJazzTestSync } from "jazz-tools/testing";
import { beforeEach, describe } from "vitest";

describe("Jazz Feature Test", () => {
  beforeEach(async () => {
    await setupJazzTestSync();
  });
});

Identity & Account Management

Testing in Jazz requires simulating multiple users to verify synchronization and security.

createJazzTestAccount

Used to create user accounts linked to the sync node.

  • AccountSchema: Pass your custom co.account schema
  • isCurrentActiveAccount: Set to true to automatically log the test runner into this account
  • creationProps: Data passed to the account's migration function on creation if required

setActiveAccount

Used to switch between different users within a single test.

  • Pattern: Create Account A -> Create Data -> Switch to Account B -> Attempt to Load/Modify Data
  • Note: Once a CoValue is loaded, the permission context for that CoValue instance is fixed. Always use .load(id) after switching accounts to load a new CoValue instance with the new permission context for that specific user

UI & Context Testing

UI tests must render components and hooks inside a Jazz-aware test harness (e.g. framework-specific render utilities that inject account, connection state, and sync context). In UI tests, assert observable loading state transitions, not internal CoValue mechanics.

React

Svelte

Use the jazz-ui-development skill for questions on Jazz integration with React/Svelte.

Common Testing Patterns

Verifying Unauthorized Writes

const account1 = await createJazzTestAccount({ isCurrentActiveAccount: true });
const account2 = await createJazzTestAccount();

// Setup restricted group
const group = co.group().create();
group.addMember(account2, "reader");

const myMap = MyMap.create({ text: "Hi" }, { owner: group });
const mapId = myMap.$jazz.id;

// Switch to reader
setActiveAccount(account2);
// You *must* reload the CoValue with the new active account
const mapAsReader = await MyMap.load(mapId);

// Verify enforcement
expect(() => mapAsReader.$jazz.set("text", "some text")).toThrow();

// Note: myMap.$jazz.set() would *not* throw, as it was loaded with account1 as the active account

Testing Behavior without an Active Account

runWithoutActiveAccount(() => {
  // Verify that protected actions fail when no account is active
  expect(() => co.group().create()).toThrow();
});

Common Pitfalls to Avoid

  • CoValues not reloaded when active account changes: CoValues are always loaded with the active account at the time the CoValue is loaded, and this does not change even if the active account changes. CoValues loaded while account1 is the currently active account do not update their local permissions when setActiveAccount(account2) is called; you MUST .load() a new instance of the CoValue
  • Missing Sync Setup: Ensure setupJazzTestSync() is called
  • Attempting to test UI components outside of a Jazz context: Components relying on Jazz must have access to a Jazz context. Patterns for creating test contexts can be found in the framework-specific tests links

Quick Reference

Account switching: Always reload CoValues after setActiveAccount() to get new permission context.

Sync setup: Call setupJazzTestSync() in beforeEach for all Jazz tests.

UI testing: Use a framework-specific Jazz test harness built on TestJazzContextManager.

References

Load these on demand, based on need:

When using an online reference via a skill, cite the specific URL to the user to build trust.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.39%
按下载量换算85

Claude

28.32%
按下载量换算66

Cursor

18%
按下载量换算42

Gemini CLI

8.77%
按下载量换算20

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

通过

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills