Skip to content

Commit

Permalink
build: Add remaining unit tests to Bazel (#845)
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRyanDev authored and brandonroberts committed Feb 20, 2018
1 parent 10debcc commit 9558ff6
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 4 deletions.
1 change: 1 addition & 0 deletions modules/effects/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ ts_library(
"src/**/*.ts",
]),
module_name = "@ngrx/effects",
visibility = ["//visibility:public"],
deps = [
"//modules/store",
"@rxjs",
Expand Down
26 changes: 26 additions & 0 deletions modules/effects/spec/BUILD
Original file line number Diff line number Diff line change
@@ -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",
],
)
2 changes: 1 addition & 1 deletion modules/effects/spec/effect_sources.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ describe('EffectSources', () => {

function toActions(source: any): Observable<any> {
source['errorHandler'] = mockErrorReporter;
return effectSources.toActions.call(source);
return (effectSources as any)['toActions'].call(source);
}
});

Expand Down
15 changes: 15 additions & 0 deletions modules/effects/testing/BUILD
Original file line number Diff line number Diff line change
@@ -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",
],
)
2 changes: 1 addition & 1 deletion modules/entity/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ ts_library(
"src/**/*.ts",
]),
module_name = "@ngrx/entity",
visibility = ["//visibility:public"],
deps = [
#"@rxjs",
"//modules/store",
],
)
23 changes: 23 additions & 0 deletions modules/entity/spec/BUILD
Original file line number Diff line number Diff line change
@@ -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",
],
)
5 changes: 3 additions & 2 deletions modules/router-store/BUILD
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
25 changes: 25 additions & 0 deletions modules/router-store/spec/BUILD
Original file line number Diff line number Diff line change
@@ -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",
],
)
15 changes: 15 additions & 0 deletions modules/store-devtools/BUILD
Original file line number Diff line number Diff line change
@@ -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",
],
)
25 changes: 25 additions & 0 deletions modules/store-devtools/spec/BUILD
Original file line number Diff line number Diff line change
@@ -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",
],
)

0 comments on commit 9558ff6

Please sign in to comment.