charted-red
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseContext
上下文
- designDocPath: $ARGUMENTS[0]
- testFilePath: $ARGUMENTS[1]
- designDocPath: $ARGUMENTS[0]
- testFilePath: $ARGUMENTS[1]
Task
任务
Based on the design doc at ${designDocPath} (if present), implement the body of the next todo test in ${testFilePath} without enabling it (i.e. keep "it.todo").
- Remove the step-by-step comment instructions from the test body and replace them with actual code.
- Remember that you love TDD and you want to write tests first.
- Implement the test only, do not implement the feature.
根据 ${designDocPath} 中的设计文档(如果存在),在 ${testFilePath} 中实现下一个 todo 测试的主体部分,但不要启用该测试(即保持 "it.todo")。
- 删除测试主体中逐步操作的注释说明,并将其替换为实际代码。
- 记住,你热爱 TDD,并且希望优先编写测试。
- 仅实现测试,不要实现功能。
Example
示例
Before
修改前
ts
it.todo("compute sum", () => {
// Inject calculator
// Call calculator.sum(1, 2)
// Assert that the result is 3
});ts
it.todo("compute sum", () => {
// Inject calculator
// Call calculator.sum(1, 2)
// Assert that the result is 3
});After
修改后
ts
it.todo("compute sum", () => {
const calculator = t.inject(Calculator);
const result = calculator.sum(1, 2);
expect(result).toBe(3);
});ts
it.todo("compute sum", () => {
const calculator = t.inject(Calculator);
const result = calculator.sum(1, 2);
expect(result).toBe(3);
});