From 9558ff61d7ecfdf6f170f70ee823ecb926c53dc3 Mon Sep 17 00:00:00 2001 From: Mike Ryan Date: Mon, 19 Feb 2018 21:58:56 -0600 Subject: [PATCH] build: Add remaining unit tests to Bazel (#845) --- modules/effects/BUILD | 1 + modules/effects/spec/BUILD | 26 +++++++++++++++++++++ modules/effects/spec/effect_sources.spec.ts | 2 +- modules/effects/testing/BUILD | 15 ++++++++++++ modules/entity/BUILD | 2 +- modules/entity/spec/BUILD | 23 ++++++++++++++++++ modules/router-store/BUILD | 5 ++-- modules/router-store/spec/BUILD | 25 ++++++++++++++++++++ modules/store-devtools/BUILD | 15 ++++++++++++ modules/store-devtools/spec/BUILD | 25 ++++++++++++++++++++ 10 files changed, 135 insertions(+), 4 deletions(-) create mode 100644 modules/effects/spec/BUILD create mode 100644 modules/effects/testing/BUILD create mode 100644 modules/entity/spec/BUILD create mode 100644 modules/router-store/spec/BUILD create mode 100644 modules/store-devtools/BUILD create mode 100644 modules/store-devtools/spec/BUILD diff --git a/modules/effects/BUILD b/modules/effects/BUILD index b4505864c0..a74c63d96c 100644 --- a/modules/effects/BUILD +++ b/modules/effects/BUILD @@ -7,6 +7,7 @@ ts_library( "src/**/*.ts", ]), module_name = "@ngrx/effects", + visibility = ["//visibility:public"], deps = [ "//modules/store", "@rxjs", diff --git a/modules/effects/spec/BUILD b/modules/effects/spec/BUILD new file mode 100644 index 0000000000..0b21a81dc6 --- /dev/null +++ b/modules/effects/spec/BUILD @@ -0,0 +1,26 @@ +load("//tools:defaults.bzl", "ts_test_library", "jasmine_node_test") + +ts_test_library( + name = "test_lib", + srcs = glob( + [ + "**/*.ts", + ], + exclude = ["ngc/**/*.ts"], + ), + deps = [ + "//modules/effects", + "//modules/store", + "@rxjs", + ], +) + +jasmine_node_test( + name = "test", + deps = [ + ":test_lib", + "//modules/effects", + "//modules/store", + "@rxjs", + ], +) diff --git a/modules/effects/spec/effect_sources.spec.ts b/modules/effects/spec/effect_sources.spec.ts index 9ca476baf9..298cf053d8 100644 --- a/modules/effects/spec/effect_sources.spec.ts +++ b/modules/effects/spec/effect_sources.spec.ts @@ -111,7 +111,7 @@ describe('EffectSources', () => { function toActions(source: any): Observable { source['errorHandler'] = mockErrorReporter; - return effectSources.toActions.call(source); + return (effectSources as any)['toActions'].call(source); } }); diff --git a/modules/effects/testing/BUILD b/modules/effects/testing/BUILD new file mode 100644 index 0000000000..39ff014c25 --- /dev/null +++ b/modules/effects/testing/BUILD @@ -0,0 +1,15 @@ +load("//tools:defaults.bzl", "ts_library") + +ts_library( + name = "testing", + srcs = glob([ + "*.ts", + "src/**/*.ts", + ]), + module_name = "@ngrx/effects/testing", + visibility = ["//visibility:public"], + deps = [ + "//modules/effects", + "@rxjs", + ], +) diff --git a/modules/entity/BUILD b/modules/entity/BUILD index aebeb0710e..370e7d76d0 100644 --- a/modules/entity/BUILD +++ b/modules/entity/BUILD @@ -7,8 +7,8 @@ ts_library( "src/**/*.ts", ]), module_name = "@ngrx/entity", + visibility = ["//visibility:public"], deps = [ - #"@rxjs", "//modules/store", ], ) diff --git a/modules/entity/spec/BUILD b/modules/entity/spec/BUILD new file mode 100644 index 0000000000..9c1b38948d --- /dev/null +++ b/modules/entity/spec/BUILD @@ -0,0 +1,23 @@ +load("//tools:defaults.bzl", "ts_test_library", "jasmine_node_test") + +ts_test_library( + name = "test_lib", + srcs = glob( + [ + "**/*.ts", + ], + ), + deps = [ + "//modules/entity", + "@rxjs", + ], +) + +jasmine_node_test( + name = "test", + deps = [ + ":test_lib", + "//modules/entity", + "@rxjs", + ], +) diff --git a/modules/router-store/BUILD b/modules/router-store/BUILD index bf925c4312..ad43706815 100644 --- a/modules/router-store/BUILD +++ b/modules/router-store/BUILD @@ -1,12 +1,13 @@ load("//tools:defaults.bzl", "ts_library") ts_library( - name = "entity", + name = "router-store", srcs = glob([ "*.ts", "src/**/*.ts", ]), - module_name = "@ngrx/entity", + module_name = "@ngrx/router-store", + visibility = ["//visibility:public"], deps = [ "//modules/store", "@rxjs", diff --git a/modules/router-store/spec/BUILD b/modules/router-store/spec/BUILD new file mode 100644 index 0000000000..23e7f1a034 --- /dev/null +++ b/modules/router-store/spec/BUILD @@ -0,0 +1,25 @@ +load("//tools:defaults.bzl", "ts_test_library", "jasmine_node_test") + +ts_test_library( + name = "test_lib", + srcs = glob( + [ + "**/*.ts", + ], + ), + deps = [ + "//modules/router-store", + "//modules/store", + "@rxjs", + ], +) + +jasmine_node_test( + name = "test", + deps = [ + ":test_lib", + "//modules/router-store", + "//modules/store", + "@rxjs", + ], +) diff --git a/modules/store-devtools/BUILD b/modules/store-devtools/BUILD new file mode 100644 index 0000000000..4ee44e9f5a --- /dev/null +++ b/modules/store-devtools/BUILD @@ -0,0 +1,15 @@ +load("//tools:defaults.bzl", "ts_library") + +ts_library( + name = "store-devtools", + srcs = glob([ + "*.ts", + "src/**/*.ts", + ]), + module_name = "@ngrx/store-devtools", + visibility = ["//visibility:public"], + deps = [ + "//modules/store", + "@rxjs", + ], +) diff --git a/modules/store-devtools/spec/BUILD b/modules/store-devtools/spec/BUILD new file mode 100644 index 0000000000..17411c1c88 --- /dev/null +++ b/modules/store-devtools/spec/BUILD @@ -0,0 +1,25 @@ +load("//tools:defaults.bzl", "ts_test_library", "jasmine_node_test") + +ts_test_library( + name = "test_lib", + srcs = glob( + [ + "**/*.ts", + ], + ), + deps = [ + "//modules/store", + "//modules/store-devtools", + "@rxjs", + ], +) + +jasmine_node_test( + name = "test", + deps = [ + ":test_lib", + "//modules/store", + "//modules/store-devtools", + "@rxjs", + ], +)