Skip to content

Commit

Permalink
fixup! feat(builtin): use linker for all generated :bin targets
Browse files Browse the repository at this point in the history
  • Loading branch information
gregmagolan authored and alexeagle committed Apr 11, 2020
1 parent 8e6c7f7 commit ec5d67c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 23 deletions.
17 changes: 1 addition & 16 deletions packages/karma/src/karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -246,22 +246,7 @@ try {
// BEGIN USER FILES
TMPL_user_files
// END USER FILES
].forEach(f => {
let filePath = null;
if (f.startsWith('NODE_MODULES/')) {
try {
// attempt to resolve in nested node_modules first
filePath = runfiles.resolve(f.replace(/^NODE_MODULES\//, '@bazel/karma/node_modules/'));
} catch (e) {
// if that failed then attempt to resolve in root node_modules
filePath = runfiles.resolve(f.replace(/^NODE_MODULES\//, ''));
}
} else {
filePath = runfiles.resolve(f);
}

conf.files.push(filePath);
});
].forEach(f => conf.files.push(runfiles.resolve(f)))

var requireConfigContent = `
// A simplified version of Karma's requirejs.config.tpl.js for use with Karma under Bazel.
Expand Down
7 changes: 2 additions & 5 deletions packages/karma/src/karma_web_test.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,9 @@ def _write_karma_config(ctx, files, amd_names_shim):
# That allows bootstrap files to have anonymous AMD modules, or to do some
# polyfilling before test libraries load.
# See https://github.com/karma-runner/karma/issues/699
# `NODE_MODULES/` is a prefix recogized by karma.conf.js to allow
# for a priority require of nested `@bazel/typescript/node_modules` before
# looking in root node_modules.
bootstrap_entries += [
"NODE_MODULES/%s" % _find_dep(ctx, "requirejs/require.js"),
"NODE_MODULES/%s" % _find_dep(ctx, "karma-requirejs/lib/adapter.js"),
_find_dep(ctx, "requirejs/require.js"),
_find_dep(ctx, "karma-requirejs/lib/adapter.js"),
"/".join([ctx.workspace_name, amd_names_shim.short_path]),
]

Expand Down
4 changes: 2 additions & 2 deletions packages/karma/test/karma_typescript/user_files.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ describe('karma_web_test_suite', () => {
return l.trim().slice(1, -1);
}).filter(l => !!l);
expect(files).toEqual([
'NODE_MODULES/npm/node_modules/requirejs/require.js',
'NODE_MODULES/npm/node_modules/karma-requirejs/lib/adapter.js',
'npm/node_modules/requirejs/require.js',
'npm/node_modules/karma-requirejs/lib/adapter.js',
'build_bazel_rules_nodejs/packages/karma/test/karma_typescript/_testing_wrapped_test.amd_names_shim.js',
]);
});
Expand Down

0 comments on commit ec5d67c

Please sign in to comment.