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:
parent
20babd9bfa
commit
1d4f8298a7
1 changed files with 6 additions and 5 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue