rdf-test-suite
Version:
Executes the RDF and SPARQL test suites.
30 lines (29 loc) • 1.18 kB
TypeScript
import { Resource } from "rdf-object";
import { IFetchOptions } from "../Util";
import { ITestCaseHandler } from "./ITestCaseHandler";
import { ITestResultOverride } from '../TestSuiteRunner';
export interface ITestCaseData {
uri: string;
types: string[];
name: string;
comment: string;
approval: string;
approvedBy: string;
}
/**
* A test case data holder.
*/
export interface ITestCase<H> extends ITestCaseData {
type: string;
test(handler: H, injectArguments: any): Promise<void | ITestResultOverride>;
}
/**
* Create a test case object from a resource.
* @param {{[uri: string]: ITestCaseHandler<ITestCase<any>>}} testCaseHandlers Handlers for constructing test cases.
* @param {string} cachePath The base directory to cache files in. If falsy, then no cache will be used.
* @param {Resource} resource A resource.
* @return {Promise<ITestCase<any>>} A promise resolving to a test case object.
*/
export declare function testCaseFromResource(testCaseHandlers: {
[uri: string]: ITestCaseHandler<ITestCase<any>>;
}, options: IFetchOptions, resource: Resource, allowMultiple?: boolean): Promise<ITestCase<any> | ITestCase<any>[] | null>;