build(bazel): re-enable packages/upgrade/test:test_web test with static_files in ts_web_test_suite (#24214)

PR Close #24214
This commit is contained in:
Greg Magolan 2018-05-30 23:49:37 -07:00 committed by Victor Berchet
parent 5f178f3a5a
commit 68a799e950
4 changed files with 17 additions and 10 deletions

View File

@ -48,10 +48,11 @@ filegroup(
)
filegroup(
name = "angularjs",
# do not sort
name = "angularjs_scripts",
srcs = [
"//:node_modules/angular/angular.js",
"//:node_modules/angular-1.5/angular.js",
"//:node_modules/angular-mocks-1.5/angular-mocks.js",
"//:node_modules/angular-mocks/angular-mocks.js",
"//:node_modules/angular/angular.js",
],
)

View File

@ -94,6 +94,16 @@ module.exports = function(config) {
'**/*.js': ['sourcemap'],
},
// Bazel inter-op: Allow tests to request resources from either
// /base/node_modules/path/to/thing
// or
// /base/angular/node_modules/path/to/thing
// This can be removed when all karma tests are run under Bazel, then we
// don't need this entire config file.
proxies: {
'/base/angular/': '/base/',
},
reporters: ['internal-angular'],
sauceLabs: {
testName: 'Angular2',

View File

@ -20,13 +20,9 @@ ts_library(
ts_web_test_suite(
name = "test_web",
bootstrap = [
# "//:angularjs",
static_files = [
"//:angularjs_scripts",
],
# Disable since tests need to request different AngularJS versions at
# runtime, which is not yet supported.
# (Related issue: https://github.com/bazelbuild/rules_typescript/issues/131)
tags = ["manual"],
deps = [
":test_lib",
],

View File

@ -28,7 +28,7 @@ export function createWithEachNg1VersionFn(setNg1: typeof setAngularJSGlobal) {
.reduce(
(prev, file) => prev.then(() => new Promise<void>((resolve, reject) => {
const script = document.createElement('script');
script.src = `base/node_modules/${file}`;
script.src = `base/angular/node_modules/${file}`;
script.onerror = reject;
script.onload = () => {
document.body.removeChild(script);