Skip to content

Commit 1160b81

Browse files
mheveryIgorMinar
authored andcommitted
build(router): enable bazel tests for router
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`.
1 parent 7e063d5 commit 1160b81

3 files changed

Lines changed: 2 additions & 5 deletions

File tree

‎packages/router/src/apply_redirects.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class ApplyRedirects {
166166
const concattedProcessedRoutes$ = concatAll.call(processedRoutes$);
167167
const first$ = first.call(concattedProcessedRoutes$, (s: any) => !!s);
168168
return _catch.call(first$, (e: any, _: any): Observable<UrlSegmentGroup> => {
169-
if (e instanceof EmptyError) {
169+
if (e instanceof EmptyError || e.name === 'EmptyError') {
170170
if (this.noLeftoversInUrl(segmentGroup, segments, outlet)) {
171171
return of (new UrlSegmentGroup([], {}));
172172
}

‎packages/router/test/BUILD.bazel‎

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ ts_library(
2323
jasmine_node_test(
2424
name = "test",
2525
bootstrap = ["angular_src/packages/_testing_init/init_node_spec.js"],
26-
# dissable since tests are running but not yet passing
27-
tags = ["manual"],
2826
deps = [
2927
":test_lib",
3028
"//packages/_testing_init:node",
@@ -36,8 +34,6 @@ ts_web_test(
3634
bootstrap = [
3735
"//:angular_bootstrap_scripts",
3836
],
39-
# dissable since tests are running but not yet passing
40-
tags = ["manual"],
4137
# do not sort
4238
deps = [
4339
"//packages/_testing_init:browser",

‎packages/router/test/bootstrap.spec.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import {NavigationEnd, Resolve, Router, RouterModule} from '@angular/router';
1515

1616

1717
describe('bootstrap', () => {
18+
if (isNode) return;
1819
let log: any[] = [];
1920
let testProviders: any[] = null !;
2021

0 commit comments

Comments
 (0)