Documentation tests

    This makes sure that examples within your documentation are up to date and working.

    The triple backticks mark the start and end of code blocks, the language is determined by the language identifier attribute which may be any of the following:

    • jsx
    • ts
    • tsx

    If this example was in a file named foo.ts, running deno test --doc foo.ts will extract this example, and then type-check it as a standalone module living in the same directory as the module being documented.

    1. * # Examples
    2. *
    3. * ```ts
    4. * import { foo } from "./foo.ts";
    5. */
    6. export function foo(): string {
    7. return "foo";
    8. }