You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
1.4 KiB
18 lines
1.4 KiB
/**
|
|
* Handles some boilerplate around defining a simple jest/Jasmine test for a
|
|
* jscodeshift transform.
|
|
* @param {String} dirName contains the name of the directory the test is located in. This
|
|
* should normally be passed via __dirname.
|
|
* @param {String} transformName contains the filename of the transform being tested,
|
|
* excluding the .js extension.
|
|
* @param {String} [testFilePrefix] Optionally contains the name of the file with the test
|
|
* data. If not specified, it defaults to the same value as `transformName`.
|
|
* This will be suffixed with ".input.js" for the input file and ".output.js"
|
|
* for the expected output. For example, if set to "foo", we will read the
|
|
* "foo.input.js" file, pass this to the transform, and expect its output to
|
|
* be equal to the contents of "foo.output.js".
|
|
* @param {any} transformObject Object to be transformed with the transformations
|
|
* @param {String} action init, update or remove, decides how to format the AST
|
|
* @return {Void} Jest makes sure to execute the globally defined functions
|
|
*/
|
|
export default function defineTest(dirName: string, transformName: string, testFilePrefix?: string, transformObject?: object | string, action?: object | string): void;
|
|
|