From 1d4f8298a7cdead528b5c08c9b762b261d3b3ea3 Mon Sep 17 00:00:00 2001 From: Satya Rohith Date: Mon, 4 Jan 2021 20:25:57 +0530 Subject: docs: meta updates to cli/tests/unit/README.md (#8969) --- cli/tests/unit/README.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'cli/tests') 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 -- cgit v1.2.3