diff --git a/BUILD.bazel b/BUILD.bazel index d92e4a43a6..9f477adf5b 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -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", ], ) diff --git a/karma-js.conf.js b/karma-js.conf.js index 815b36fba9..0028c738c2 100644 --- a/karma-js.conf.js +++ b/karma-js.conf.js @@ -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', diff --git a/packages/upgrade/test/BUILD.bazel b/packages/upgrade/test/BUILD.bazel index 635eef6a57..d6fc0c92e7 100644 --- a/packages/upgrade/test/BUILD.bazel +++ b/packages/upgrade/test/BUILD.bazel @@ -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", ], diff --git a/packages/upgrade/test/common/test_helpers.ts b/packages/upgrade/test/common/test_helpers.ts index e03f243367..1f5a27e979 100644 --- a/packages/upgrade/test/common/test_helpers.ts +++ b/packages/upgrade/test/common/test_helpers.ts @@ -28,7 +28,7 @@ export function createWithEachNg1VersionFn(setNg1: typeof setAngularJSGlobal) { .reduce( (prev, file) => prev.then(() => new Promise((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);