folio
Version:
A customizable test framework to build your own test frameworks. Foundation for the [Playwright test runner](https://github.com/microsoft/playwright-test).
78 lines • 2.44 kB
TypeScript
/**
* Copyright Microsoft Corporation. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/// <reference types="node" />
import { Parameters, TestError, TestStatus } from './ipc';
export { Parameters, TestStatus, TestError } from './ipc';
import type { FolioImpl } from './spec';
declare class Base {
title: string;
file: string;
line: number;
column: number;
parent?: Suite;
_only: boolean;
_ordinal: number;
_folio: FolioImpl;
constructor(folio: FolioImpl, title: string, parent?: Suite);
titlePath(): string[];
fullTitle(): string;
}
export declare class Spec extends Base {
fn: Function;
tests: Test[];
constructor(fixtures: FolioImpl, title: string, fn: Function, suite: Suite);
ok(): boolean;
}
export declare class Suite extends Base {
suites: Suite[];
specs: Spec[];
_entries: (Suite | Spec)[];
total: number;
constructor(fixtures: FolioImpl, title: string, parent?: Suite);
_addSpec(spec: Spec): void;
_addSuite(suite: Suite): void;
findTest(fn: (test: Test) => boolean | void): boolean;
findSpec(fn: (spec: Spec) => boolean | void): boolean;
findSuite(fn: (suite: Suite) => boolean | void): boolean;
_allSpecs(): Spec[];
_renumber(): void;
_countTotal(): void;
_hasOnly(): boolean;
}
export declare class Test {
spec: Spec;
parameters: Parameters;
results: TestResult[];
skipped: boolean;
slow: boolean;
expectedStatus: TestStatus;
timeout: number;
annotations: any[];
constructor(spec: Spec);
status(): 'skipped' | 'expected' | 'unexpected' | 'flaky';
ok(): boolean;
}
export declare type TestResult = {
retry: number;
workerIndex: number;
duration: number;
status?: TestStatus;
error?: TestError;
stdout: (string | Buffer)[];
stderr: (string | Buffer)[];
data: any;
};
//# sourceMappingURL=test.d.ts.map