Spec-Zone.ru › Deno 2

test/reporters

Модуль node:test/reporters предоставляет встроенные репортеры для node:test. Чтобы получить к нему доступ:

import test from 'node:test/reporters';

Этот модуль доступен только при использовании схемы node:. Следующий код не будет работать:

import test from 'node:test/reporters';

Использование в Deno

import * as mod from "node:test/reporters";

класс LcovReporter

наследует Transform

Использование в Deno

import { LcovReporter } from "node:test/reporters";

Краткое описание конструкторов

LcovReporter(opts?: Omit<TransformOptions, "writableObjectMode">)
новый

класс SpecReporter

наследует Transform

Использование в Deno

import { SpecReporter } from "node:test/reporters";

Краткое описание конструкторов

SpecReporter()
новый

функция dot

Использование в Deno

import { dot } from "node:test/reporters";
dot(source: TestEventGenerator): AsyncGenerator<
"\n"
| "."
| "X"
, void>

Репортер dot выводит результаты тестов в компактном формате: каждый успешно пройденный тест обозначается ., а каждый не пройденный тест — X.

Параметры

source: TestEventGenerator

Тип возвращаемого значения

AsyncGenerator<
"\n"
| "."
| "X"
, void>

функция junit

Использование в Deno

import { junit } from "node:test/reporters";
junit(source: TestEventGenerator): AsyncGenerator<string, void>

Репортер junit выводит результаты тестов в формате XML jUnit.

Параметры

source: TestEventGenerator

Тип возвращаемого значения

AsyncGenerator<string, void>

функция tap

Использование в Deno

import { tap } from "node:test/reporters";
tap(source: TestEventGenerator): AsyncGenerator<string, void>

Репортер tap выводит результаты тестов в формате TAP.

Параметры

source: TestEventGenerator

Тип возвращаемого значения

AsyncGenerator<string, void>

интерфейс ReporterConstructorWrapper

Использование в Deno

import { type ReporterConstructorWrapper } from "node:test/reporters";

Параметры типа

T extends new (...args: any[]) => Transform

Сигнатуры вызова

(...args: ConstructorParameters<T>): InstanceType<T>

псевдоним типа TestEvent

Использование в Deno

import { type TestEvent } from "node:test/reporters";

Определение

{ type: "test:coverage"; data: TestCoverage; }
| { type: "test:complete"; data: TestComplete; }
| { type: "test:dequeue"; data: TestDequeue; }
| { type: "test:diagnostic"; data: DiagnosticData; }
| { type: "test:enqueue"; data: TestEnqueue; }
| { type: "test:fail"; data: TestFail; }
| { type: "test:pass"; data: TestPass; }
| { type: "test:plan"; data: TestPlan; }
| { type: "test:start"; data: TestStart; }
| { type: "test:stderr"; data: TestStderr; }
| { type: "test:stdout"; data: TestStdout; }
| { type: "test:summary"; data: TestSummary; }
| { type: "test:watch:drained"; data: undefined; }

псевдоним типа TestEventGenerator

Использование в Deno

import { type TestEventGenerator } from "node:test/reporters";

Определение

AsyncGenerator<TestEvent, void>

переменная lcov

Использование в Deno

import { lcov } from "node:test/reporters";

Репортер lcov выводит данные о покрытии тестами при использовании флага --experimental-test-coverage.

Тип

LcovReporter

переменная spec

Использование в Deno

import { spec } from "node:test/reporters";

Репортер spec выводит результаты тестов в удобном для чтения формате.

Тип

ReporterConstructorWrapper<SpecReporter>

© 2018–2025 the Deno authors
Licensed under the MIT License.
https://docs.deno.com/api/node/test/reporters

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API