* 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)
| 63 | * @return {string} |
| 64 | */ |
| 65 | function 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. |