aboutsummaryrefslogtreecommitdiff
path: root/docs/guides/test/skip-tests.md
diff options
context:
space:
mode:
authorGravatar Colin McDonnell <colinmcd94@gmail.com> 2023-08-24 22:28:07 -0700
committerGravatar GitHub <noreply@github.com> 2023-08-24 22:28:07 -0700
commit73b3fb7b0fa7cc786e147ccf1247cd9883ad8e59 (patch)
treecf26d0aad9b0b90904989c07fc344e37c6fe5f2a /docs/guides/test/skip-tests.md
parent2bcbafe7d32c18f611f7c7bd20e4c9d4d92a18ea (diff)
downloadbun-73b3fb7b0fa7cc786e147ccf1247cd9883ad8e59.tar.gz
bun-73b3fb7b0fa7cc786e147ccf1247cd9883ad8e59.tar.zst
bun-73b3fb7b0fa7cc786e147ccf1247cd9883ad8e59.zip
Add guides for test runner (#4308)
Diffstat (limited to 'docs/guides/test/skip-tests.md')
-rw-r--r--docs/guides/test/skip-tests.md37
1 files changed, 37 insertions, 0 deletions
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)