()
| 125 | // The project root path may contain unicode characters. |
| 126 | const kProjectRoot = '<project-root>'; |
| 127 | function transformProjectRoot() { |
| 128 | const projectRoot = path.resolve(__dirname, '../..'); |
| 129 | if (process.env.NODE_TEST_DIR) { |
| 130 | const testDir = realpathSync(process.env.NODE_TEST_DIR); |
| 131 | // On Jenkins CI, the test dir may be overridden by `NODE_TEST_DIR`. |
| 132 | return transform( |
| 133 | transformPath(projectRoot, kProjectRoot), |
| 134 | transformPath(testDir, `${kProjectRoot}/test`), |
| 135 | // TODO(legendecas): test-runner may print relative paths to the test relative to cwd. |
| 136 | // It will be better if we could distinguish them from the project root. |
| 137 | transformPath(path.relative(projectRoot, testDir), 'test'), |
| 138 | ); |
| 139 | } |
| 140 | return transformPath(projectRoot, kProjectRoot); |
| 141 | } |
| 142 | |
| 143 | // Replaces tmpdirs created by `test/common/tmpdir.js`. |
| 144 | function transformTmpDir(str) { |
no test coverage detected
searching dependent graphs…