europa-test
Version:
Test framework for Europa Core implementations
57 lines (56 loc) • 1.85 kB
TypeScript
import { EuropaOptions } from 'europa-core';
/**
* The base test fixture containing only the minimum information required to set up the test.
*/
export declare type BaseTestFixture = {
/**
* The description of the test fixture.
*/
readonly description: string;
/**
* Any options to be passed to the {@link EuropaCore} implementation constructor.
*/
readonly options?: EuropaOptions;
};
/**
* A test fixture that is bundled within `europa-test` itself.
*
* Such fixtures are tested against all {@link EuropaCore} implementations.
*/
export declare type BundledTestFixture = TestFixture<any> & {
/**
* Whether the test fixture is bundled within `europa-test`.
*/
readonly bundled: true;
};
/**
* A test fixture that is tested using the contents of a pair of files; An HTML file used as the test input and a
* Markdown file used as expected test output.
*/
export declare type FileTestFixture = BaseTestFixture & {
/**
* The base file path of the test fixture.
*
* This will be appended with `.html` and `.md` and the corresponding files will be loaded during test execution. The
* content of the `.html` file is used as the test input and the contents of the `.md` file is used as the expected
* test output compared against the actual test output.
*/
readonly baseFilePath: string;
};
/**
* A test fixture where the test input and expected output is declared up-front.
*/
export declare type InlineTestFixture<N> = BaseTestFixture & {
/**
* The expected Markdown output for the test.
*/
readonly expected: string;
/**
* The HTML/DOM input for the test.
*/
readonly input: N | N[] | string;
};
/**
* An individual test fixture.
*/
export declare type TestFixture<N> = FileTestFixture | InlineTestFixture<N>;