summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSatya Rohith <me@satyarohith.com>2021-01-04 20:25:57 +0530
committerGitHub <noreply@github.com>2021-01-04 15:55:57 +0100
commit1d4f8298a7cdead528b5c08c9b762b261d3b3ea3 (patch)
tree8590784cbec8cb64147d0c9fee15294cc92aed5c
parent20babd9bfaf0ee78c462ab8a28eb67660d858b94 (diff)
docs: meta updates to cli/tests/unit/README.md (#8969)
-rw-r--r--cli/tests/unit/README.md11
1 files changed, 6 insertions, 5 deletions
diff --git a/cli/tests/unit/README.md b/cli/tests/unit/README.md
index 4d70ada78..7f0b243fe 100644
--- a/cli/tests/unit/README.md
+++ b/cli/tests/unit/README.md
@@ -6,24 +6,25 @@ Testing Deno runtime code requires checking API under different runtime
permissions (ie. running with different `--allow-*` flags). To accomplish this
all tests exercised are created using `unitTest()` function.
-```
+```ts
import { unitTest } from "./test_util.ts";
unitTest(function simpleTestFn(): void {
// test code here
});
-unitTest({
+unitTest(
+ {
ignore: Deno.build.os === "windows",
perms: { read: true, write: true },
},
function complexTestFn(): void {
// test code here
- }
+ },
);
```
-`unitTest` is is a wrapper function that enhances `Deno.test()` API in several
+`unitTest` is a wrapper function that enhances `Deno.test()` API in several
ways:
- ability to conditionally skip tests using `UnitTestOptions.skip`.
@@ -44,7 +45,7 @@ Runner discovers required permissions combinations by loading
There are three ways to run `unit_test_runner.ts`:
-```
+```sh
# Run all tests. Spawns worker processes for each discovered permission
# combination:
target/debug/deno run -A cli/tests/unit/unit_test_runner.ts --master