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

Function getTestPath

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

* Computes the relative dirname of the input from the test directory. * For example, if the input is "test/foo/bar/input.html", we get "foo/bar". * * @param {string} inputFile * @return {string}

(inputFile)

Source from the content-addressed store, hash-verified

63 * @return {string}
64 */
65function getTestPath(inputFile) {
66 let testDir = inputFile;
67 while (path.basename(testDir) != 'test') {
68 testDir = path.dirname(testDir);
69 }
70 return path.dirname(path.relative(testDir, inputFile));
71}
72
73/**
74 * Extracts the expected output for a test from its output file.

Callers 1

getTestNameFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected