sortier
Version:
An opinionated code sorter
39 lines (38 loc) • 1.79 kB
TypeScript
type TestInputTransform = (inputFilePath: string, inputFileContents: string) => string;
/**
* Given a directory, reads all the files from the test_assets folder in that directory and generates
* an array of tests information to be run.
*
* The file format for all files in the test_assets folder should be as follows:
* - Input: (category_path\.)*?test_name.input.extension.txt
* - Output: (category_path\.)*?test_name.output.extension.txt
*
* Given this, some valid examples are:
* - context_barrier.input.css.txt
* - es6.imports.input.js.txt
* - es6.spread.imports.input.js.txt
*
* @param testFileUrl The test file that has a test_assets folder as a sibling
* @param transform The reprinting logic to transform the input code and return the output
*/
export declare function runTestAssetsTests(testFileUrl: string, transform: TestInputTransform): void;
export declare function getFolderPathFromFileUrl(filePath: string): string;
/**
* Given a directory, reads all the files from the test_assets folder in that directory and generates
* an array of tests information to be run.
*
* The file format for all files in the test_assets folder should be as follows:
* - Input: (category_path\.)*?test_name.input.extension.txt
* - Output: (category_path\.)*?test_name.output.extension.txt
*
* Given this, some valid examples are:
* - context_barrier.input.css.txt
* - es6.imports.input.js.txt
* - es6.spread.imports.input.js.txt
*
* @param folderPath The directory that contains a test_assets folder
* @param transform The reprinting logic to transform the input code and return the output
* @deprecated use runTestAssetsTests instead
*/
export declare function runTestAssestsTests(folderPath: string, transform: TestInputTransform): void;
export {};