* Computes the directory of the transformer used in the test. * * @param {string} inputFile * @return {string}
(inputFile)
| 46 | * @return {string} |
| 47 | */ |
| 48 | function getTransformerDir(inputFile) { |
| 49 | // The prior assumption is that the transformer is in the parent directory. |
| 50 | // However, with Jest (and to mimic Jest), this is not necessarily true. |
| 51 | let transformerDir = inputFile; |
| 52 | while (path.basename(path.dirname(transformerDir)) != 'transforms') { |
| 53 | transformerDir = path.dirname(transformerDir); |
| 54 | } |
| 55 | return transformerDir; |
| 56 | } |
| 57 | |
| 58 | /** |
| 59 | * Computes the relative dirname of the input from the test directory. |
no outgoing calls
no test coverage detected