diff options
author | Bartek IwaĆczuk <biwanczuk@gmail.com> | 2020-02-11 12:01:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-11 12:01:56 +0100 |
commit | a3bfbcceade3d359f677106399562b461b4af01a (patch) | |
tree | 93f6fcc56d98bbc0f71f5b5782381f672895f634 /cli/js/lib.deno.ns.d.ts | |
parent | 701ce9b3342647cf01cb23c4fc28bc99ce0aa8c1 (diff) |
refactor: rewrite deno test, add Deno.test() (#3865)
* rewrite test runner in Rust
* migrate "test" and "runTests" functions from std to "Deno" namespace
* use "Deno.test()" to run internal JS unit tests
* remove std downloads for Deno subcommands
Diffstat (limited to 'cli/js/lib.deno.ns.d.ts')
-rw-r--r-- | cli/js/lib.deno.ns.d.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/cli/js/lib.deno.ns.d.ts b/cli/js/lib.deno.ns.d.ts index 4bbbf6320..b96e108c3 100644 --- a/cli/js/lib.deno.ns.d.ts +++ b/cli/js/lib.deno.ns.d.ts @@ -10,6 +10,26 @@ declare namespace Deno { /** Reflects the NO_COLOR environment variable: https://no-color.org/ */ export let noColor: boolean; + export type TestFunction = () => void | Promise<void>; + + export interface TestDefinition { + fn: TestFunction; + name: string; + } + + export function test(t: TestDefinition): void; + export function test(fn: TestFunction): void; + export function test(name: string, fn: TestFunction): void; + + export interface RunTestsOptions { + exitOnFail?: boolean; + only?: RegExp; + skip?: RegExp; + disableLog?: boolean; + } + + export function runTests(opts?: RunTestsOptions): Promise<void>; + /** Check if running in terminal. * * console.log(Deno.isTTY().stdout); |