MCPcopy Create free account
hub / github.com/angular/angular / resolveRunfile

Function resolveRunfile

packages/examples/test-utils/index.ts:20–39  ·  view source on GitHub ↗
(filePath: string)

Source from the content-addressed store, hash-verified

18}
19
20function resolveRunfile(filePath: string): string {
21 if (fs.existsSync(filePath)) {
22 return filePath;
23 }
24 const runfilesDir = process.env['JS_BINARY__RUNFILES'] || process.env['RUNFILES_DIR'];
25 if (runfilesDir) {
26 const candidates = [
27 path.join(runfilesDir, filePath),
28 path.join(runfilesDir, '_main', filePath),
29 path.join(runfilesDir, filePath.replace(/^(\.\.\/)+/, '')),
30 path.join(runfilesDir, '_main', filePath.replace(/^(\.\.\/)+/, '')),
31 ];
32 for (const c of candidates) {
33 if (fs.existsSync(c)) {
34 return c;
35 }
36 }
37 }
38 return filePath;
39}
40
41export interface E2eContext {
42 driver: webdriver.WebDriver;

Callers 1

createWebDriverFunction · 0.70

Calls 2

joinMethod · 0.65
replaceMethod · 0.45

Tested by

no test coverage detected