0
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-03-03 09:31:22 -05:00

docs: meta updates to cli/tests/unit/README.md (#8969)

This commit is contained in:
Satya Rohith 2021-01-04 20:25:57 +05:30 committed by GitHub
parent 20babd9bfa
commit 1d4f8298a7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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