microvium
Version:
A compact, embeddable scripting engine for microcontrollers for executing small scripts written in a subset of JavaScript.
34 lines (33 loc) • 1.01 kB
TypeScript
import { TestFilenames } from "./common";
export interface TestCases {
run(): void;
filenames: TestFilenames;
}
export interface TestApi {
inputFilename(filename: string): string;
input(filename: string, encoding: 'utf8'): InputFileApi<string>;
actualOutputFilename(filename: string): string;
expectedOutputFilename(filename: string): string;
output(filename: string, encoding: 'utf8'): OutputFileApi<string>;
onRun(handler: () => void): void;
}
export interface InputFileApi<T> {
read(): T;
}
export interface OutputFileApi<T> {
/**
* Define what the actual output is
*/
actual: T;
/**
* Read what the expected output is
*/
readonly expected: T;
/**
* Compare the actual and expected output
*/
check(): void;
readonly actualFilename: string;
readonly expectedFilename: string;
}
export declare function testsInFolder(folder: string, defineTest: (api: TestApi) => void): TestCases;