diff --git a/third_party/github.com/bazelbuild/rules_typescript/internal/karma/karma.conf.js b/third_party/github.com/bazelbuild/rules_typescript/internal/karma/karma.conf.js index 03832f1ce9..d60c009834 100644 --- a/third_party/github.com/bazelbuild/rules_typescript/internal/karma/karma.conf.js +++ b/third_party/github.com/bazelbuild/rules_typescript/internal/karma/karma.conf.js @@ -64,50 +64,18 @@ if (!browsers.length) { browsers.push(process.env['DISPLAY'] ? 'Chrome': 'ChromeHeadless'); } -// On Windows, runfiles will not be in the runfiles folder but inteaad -// there is a MANIFEST file which maps the runfiles for the test -// to their location on disk. Bazel provides a RUNFILE_MANIFEST_FILE environment -// variable which is set the location of the MANIFEST file during test execution. -// If a MANIFEST file is found, we remap the test files to their -// location on disk using the MANIFEST file. -let manifest = null; -if (process.env.RUNFILE_MANIFEST_FILE && fs.existsSync(process.env.RUNFILE_MANIFEST_FILE)) { - // MANIFEST file contains the one runfile mapping per line seperated - // a space. For example: - // rxjs/operators.js /private/var/tmp/.../external/rxjs/operators.js - // The file is parsed here into a map of for easy lookup - manifest = {}; - for (l of fs.readFileSync(process.env.RUNFILE_MANIFEST_FILE, 'utf8').split('\n')) { - const m = l.split(' '); - manifest[m[0]] = m[1]; - } -} - -function resolveRunfiles(manifest, runfiles) { - if (manifest) { - runfiles = runfiles.map(f => { - const manifestFile = manifest[f]; - if (!manifestFile) { - throw new Error(`File not found in MANIFEST: ${f}`); - } - return manifestFile; - }); - } - return runfiles; -} - -const files = resolveRunfiles(manifest, [ +const files = [ TMPL_bootstrap_files TMPL_user_files -]); +].map(f => require.resolve(f)); // static files are added to the files array but // configured to not be included so karma-concat-js does // not included them in the bundle -resolveRunfiles(manifest, [ +[ TMPL_static_files -]).forEach(f => { - files.push({ pattern: f, included: false }); +].forEach(f => { + files.push({ pattern: require.resolve(f), included: false }); }); var requireConfigContent = `