context.todo([message])


  • message <string> 要在 TAP 输出中显示的可选 TODO 消息。

此函数将 TODO 指令添加到测试的输出中。 如果提供了 message,则它将包含在 TAP 输出中。 调用 todo() 不会终止测试函数的执行。 此函数不返回值。

test('top level test', (t) => {
  // 此测试标记为 `TODO`
  t.todo('this is a todo');
});
  • message <string> Optional TODO message to be displayed in TAP output.

This function adds a TODO directive to the test's output. If message is provided, it is included in the TAP output. Calling todo() does not terminate execution of the test function. This function does not return a value.

test('top level test', (t) => {
  // This test is marked as `TODO`
  t.todo('this is a todo');
});