Skip to main content

principle-test-behavior-not-implementation

Apply when you write, change, or keep a test. Call the code the way its users do and assert the result they observe against a literal expected value.

来源信息

仓库
Aqua-123/pstack-for-codex
最近来源活动
2026年9月10日 16:19
检测到的 SKILL.md 语言
英语
星标
81
分支
11

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

文件资源管理器
2 个文件

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
principle-test-behavior-not-implementation
description
Apply when you write, change, or keep a test. Call the code the way its users do and assert the result they observe against a literal expected value.
# Test Behavior, Not Implementation A test calls the code the way its users do and asserts the result they observe against a literal expected value. If every imported function returned `undefined`, a useful test would fail when the subject's behavior is wrong. Rewrite tests that only assert calls, truthiness, presence, constants, mocks, or fixture shape. Test the mechanism with one concrete input and a literal output or observable effect. Keep relation checks when the relation itself is the contract.
在 GitHub 查看