* Extracts the JS transform for a test from its transform file. * @param {string} inputFile * @param {!Object} extraOptions * @return {Promise }
(inputFile, extraOptions)
| 88 | * @return {Promise<string>} |
| 89 | */ |
| 90 | async function getTransform(inputFile, extraOptions) { |
| 91 | const transformDir = getTransformerDir(inputFile); |
| 92 | const parsed = path.parse(transformDir); |
| 93 | const transformPath = path.join(parsed.dir, 'dist', parsed.base); |
| 94 | const transformFile = ( |
| 95 | await fastGlob(path.resolve(transformPath, '*.js')) |
| 96 | )[0]; |
| 97 | return (await import(transformFile)).default.default(extraOptions); |
| 98 | } |
| 99 | |
| 100 | /** |
| 101 | * Computes the output for a test from its transform and input. |
no test coverage detected