测试

工程开发 社区

技能解读

当前原文的自动摘译,尚未人工审校。

参数: - $ARGUMENTS:通道、标志和测试模式

用法示例:-/test ReactFiberHooks- 使用源通道运行(默认)-/test experimental ReactFiberHooks- 使用实验通道运行 -/test www ReactFiberHooks- 使用 www-modern 频道运行 -/test www variant false ReactFiberHooks- 测试 VARIANT=false -/test stable ReactFiberHooks- 使用稳定的通道运行 -/test classic ReactFiberHooks- 使用 www-classic 频道运行 -/test watch ReactFiberHooks- 在监视模式下运行 (TDD)

发布渠道:-(default)- Source/canary 通道,使用 ReactFeatureFlags.js 默认值 -experimental- 带有 EXPERIMENTAL 标志的源/实验通道 = true -www- www-modern 频道,带有 VARIANT 标志 = true -www variant false- 带有 VARIANT 标志的 www 频道 = false -stable- 什么运送到 npm -classic- 旧版 www-classic(很少需要)

说明: 1. 从参数中解析通道(默认:源) 2. 映射到纱线命令:-(默认)→yarn test --silent --no-watchman <pattern>- 实验性 →yarn test -r=experimental --silent --no-watchman <pattern>- 稳定 →yarn test-stable --silent --no-watchman <pattern>- 经典 →yarn test-classic --silent --no-watchman <pattern>- www →yarn test-www --silent --no-watchman <pattern>- www 变体假 →yarn test-www --variant=false --silent --no-watchman <pattern>3. 报告测试结果和任何失败

硬性规则: 1. 使用 --silent 查看失败 - 这将测试输出限制为仅失败。 2. 使用--no-watchman - 这是沙箱中的常见故障。

流狐档案 运行与权限由流狐静态检查推断,不代表作者声明或实际测试结果。
领域
工程开发
作者声明的智能体
未找到明确声明;不据此推断已兼容或已测试
静态检查
88 / 100 · 启发式扫描,不代表运行安全
运行环境证据
未执行;当前没有隔离运行测试证据
作者 / 版本 / 许可证
@facebook · 未声明许可证
上下文用量评级
低消耗
接入复杂程度
即装即用
是否需要外部接口密钥
不需要
兼容的系统
macOS · Linux · Windows
运行环境要求
未检出明确要求
检测到的文件与系统行为
  • 只读
网络行为
仅限本地
安装命令数
无(仅作为资料)

需要注意: 未声明工具权限范围;实际权限由运行环境决定。

作者说明文件(原文) SKILL.md

Run tests for the React codebase.

Arguments:
- $ARGUMENTS: Channel, flags, and test pattern

Usage Examples:
- `/test ReactFiberHooks` - Run with source channel (default)
- `/test experimental ReactFiberHooks` - Run with experimental channel
- `/test www ReactFiberHooks` - Run with www-modern channel
- `/test www variant false ReactFiberHooks` - Test __VARIANT__=false
- `/test stable ReactFiberHooks` - Run with stable channel
- `/test classic ReactFiberHooks` - Run with www-classic channel
- `/test watch ReactFiberHooks` - Run in watch mode (TDD)

Release Channels:
- `(default)` - Source/canary channel, uses ReactFeatureFlags.js defaults
- `experimental` - Source/experimental channel with __EXPERIMENTAL__ flags = true
- `www` - www-modern channel with __VARIANT__ flags = true
- `www variant false` - www channel with __VARIANT__ flags = false
- `stable` - What ships to npm
- `classic` - Legacy www-classic (rarely needed)

Instructions:
1. Parse channel from arguments (default: source)
2. Map to yarn command:
   - (default) → `yarn test --silent --no-watchman <pattern>`
   - experimental → `yarn test -r=experimental --silent --no-watchman <pattern>`
   - stable → `yarn test-stable --silent --no-watchman <pattern>`
   - classic → `yarn test-classic --silent --no-watchman <pattern>`
   - www → `yarn test-www --silent --no-watchman <pattern>`
   - www variant false → `yarn test-www --variant=false --silent --no-watchman <pattern>`
3. Report test results and any failures

Hard Rules:
1. **Use --silent to see failures** - This limits the test output to only failures.
2. **Use --no-watchman** - This is a common failure in sandboxing.

Common Mistakes:
- **Running without a pattern** - Runs ALL tests, very slow. Always specify a pattern.
- **Forgetting both www variants** - Test `www` AND `www variant false` for `__VARIANT__` flags.
- **Test skipped unexpectedly** - Check for `@gate` pragma; see `feature-flags` skill.

讨论

基于 GitHub Discussions。登录 GitHub 即可参与讨论、点赞、订阅更新。