Skip to main content
要在 Bun 测试运行器中跳过测试,请使用 test.skip 函数。
https://mintcdn.com/ikxin/RzFFGbzo0-4huILA/icons/typescript.svg?fit=max&auto=format&n=RzFFGbzo0-4huILA&q=85&s=a3dffd2241f05776d3bd25171d0c5a79test.ts
import { test } from "bun:test";

test.skip("尚未实现的功能", () => {
  expect(Bun.isAwesome()).toBe(true);
});

运行 bun test 将不会执行此测试。它将在终端输出中被标记为跳过。
terminal
bun test
test.test.ts:
✓ add [0.03ms]
✓ multiply [0.02ms]
» 尚未实现的功能

 2 通过
 1 跳过
 0 失败
 2 次 expect() 调用
共执行 3 个测试,来自 1 个文件。 [74.00ms]

另请参见: