context.signal


  • <AbortSignal> 可用于在测试中止时中止测试子任务。
test('top level test', async (t) => {
  await fetch('some/uri', { signal: t.signal });
});
  • <AbortSignal> Can be used to abort test subtasks when the test has been aborted.
test('top level test', async (t) => {
  await fetch('some/uri', { signal: t.signal });
});