From 73b3fb7b0fa7cc786e147ccf1247cd9883ad8e59 Mon Sep 17 00:00:00 2001 From: Colin McDonnell Date: Thu, 24 Aug 2023 22:28:07 -0700 Subject: Add guides for test runner (#4308) --- docs/guides/test/skip-tests.md | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 docs/guides/test/skip-tests.md (limited to 'docs/guides/test/skip-tests.md') diff --git a/docs/guides/test/skip-tests.md b/docs/guides/test/skip-tests.md new file mode 100644 index 000000000..c067c8fc7 --- /dev/null +++ b/docs/guides/test/skip-tests.md @@ -0,0 +1,37 @@ +--- +name: Skip tests with the Bun test runner +--- + +To skip a test with the Bun test runner, use the `test.skip` function. + +```ts-diff +test.skip("unimplemented feature", ()=>{ + expect(Bun.isAwesome()).toBe(true); +}); +``` + +--- + +Running `bun test` will not execute this test. It will be marked as skipped in the terminal output. + +```sh +$ bun test + +test.test.ts: +✓ add [0.03ms] +✓ multiply [0.02ms] +» unimplemented feature + + 2 pass + 1 skip + 0 fail + 2 expect() calls +Ran 3 tests across 1 files. [74.00ms] +``` + +--- + +See also: + +- [Mark a test as a todo](/guides/test/todo-tests) +- [Docs > Test runner > Writing tests](/docs/test/writings-tests) -- cgit v1.2.3