mirror of
https://github.com/denoland/deno.git
synced 2025-09-22 18:32:28 +00:00
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
This commit is contained in:
parent
701ce9b334
commit
a3bfbccead
13 changed files with 452 additions and 102 deletions
20
cli/js/lib.deno.ns.d.ts
vendored
20
cli/js/lib.deno.ns.d.ts
vendored
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue