MCPcopy Index your code
hub / github.com/ampproject/amphtml / getTransformerDir

Function getTransformerDir

build-system/tasks/server-tests.js:48–56  ·  view source on GitHub ↗

* Computes the directory of the transformer used in the test. * * @param {string} inputFile * @return {string}

(inputFile)

Source from the content-addressed store, hash-verified

46 * @return {string}
47 */
48function 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.

Callers 2

getTestNameFunction · 0.85
getTransformFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected