1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-21 15:04:11 -05:00

docs: improve some JSDoc (#20841)

Minor improvements to the documentation for https://deno.com/api
This commit is contained in:
Luca Casonato 2023-11-07 01:35:22 +01:00 committed by GitHub
parent 837c870ff4
commit 777c142d39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -813,8 +813,46 @@ declare namespace Deno {
permissions?: PermissionOptions;
}
/** Register a test which will be run when `deno test` is used on the command
* line and the containing module looks like a test module.
*
* `fn` can be async if required.
*
* ```ts
* import { assertEquals } from "https://deno.land/std/testing/asserts.ts";
*
* Deno.test({
* name: "example test",
* fn() {
* assertEquals("world", "world");
* },
* });
*
* Deno.test({
* name: "example ignored test",
* ignore: Deno.build.os === "windows",
* fn() {
* // This test is ignored only on Windows machines
* },
* });
*
* Deno.test({
* name: "example async test",
* async fn() {
* const decoder = new TextDecoder("utf-8");
* const data = await Deno.readFile("hello_world.txt");
* assertEquals(decoder.decode(data), "Hello world");
* }
* });
* ```
*
* @category Testing
*/
export const test: DenoTest;
/**
* @category Testing
*/
interface DenoTest {
/** Register a test which will be run when `deno test` is used on the command
* line and the containing module looks like a test module.
@ -4300,6 +4338,8 @@ declare namespace Deno {
* status. */
output(): Promise<CommandOutput>;
/** Kills the process with given {@linkcode Deno.Signal}.
*
* Defaults to `SIGTERM` if no signal is provided.
*
* @param [signo="SIGTERM"]
*/