From 40dfe39e640123d705b1649a3c80bd552ef6cc1d Mon Sep 17 00:00:00 2001 From: Misko Hevery Date: Sun, 17 Dec 2017 20:59:37 -0800 Subject: [PATCH] build(router): enable bazel tests for router (#21053) Bazel runs on newer version of RxJs than is installed in Yarn. The never version subclasses `EmptyError` in a different way which fails the `instanceof` check. This change makes the `instanceof` check more robust with respect to `EmptyError`. PR Close #21053 --- packages/router/src/apply_redirects.ts | 2 +- packages/router/test/BUILD.bazel | 4 ---- packages/router/test/bootstrap.spec.ts | 1 + 3 files changed, 2 insertions(+), 5 deletions(-) diff --git a/packages/router/src/apply_redirects.ts b/packages/router/src/apply_redirects.ts index 0d8c386938..965b046efa 100644 --- a/packages/router/src/apply_redirects.ts +++ b/packages/router/src/apply_redirects.ts @@ -166,7 +166,7 @@ class ApplyRedirects { const concattedProcessedRoutes$ = concatAll.call(processedRoutes$); const first$ = first.call(concattedProcessedRoutes$, (s: any) => !!s); return _catch.call(first$, (e: any, _: any): Observable => { - if (e instanceof EmptyError) { + if (e instanceof EmptyError || e.name === 'EmptyError') { if (this.noLeftoversInUrl(segmentGroup, segments, outlet)) { return of (new UrlSegmentGroup([], {})); } diff --git a/packages/router/test/BUILD.bazel b/packages/router/test/BUILD.bazel index 7bf747d48c..cb83c37361 100644 --- a/packages/router/test/BUILD.bazel +++ b/packages/router/test/BUILD.bazel @@ -23,8 +23,6 @@ ts_library( jasmine_node_test( name = "test", bootstrap = ["angular_src/packages/_testing_init/init_node_spec.js"], - # dissable since tests are running but not yet passing - tags = ["manual"], deps = [ ":test_lib", "//packages/_testing_init:node", @@ -36,8 +34,6 @@ ts_web_test( bootstrap = [ "//:angular_bootstrap_scripts", ], - # dissable since tests are running but not yet passing - tags = ["manual"], # do not sort deps = [ "//packages/_testing_init:browser", diff --git a/packages/router/test/bootstrap.spec.ts b/packages/router/test/bootstrap.spec.ts index 1c7789eb53..82555905e2 100644 --- a/packages/router/test/bootstrap.spec.ts +++ b/packages/router/test/bootstrap.spec.ts @@ -15,6 +15,7 @@ import {NavigationEnd, Resolve, Router, RouterModule} from '@angular/router'; describe('bootstrap', () => { + if (isNode) return; let log: any[] = []; let testProviders: any[] = null !;