Skip to content

Commit 1ab947e

Browse files
committed
test(@angular-devkit/build-optimizer): add bazel tests
1 parent 1a21fc5 commit 1ab947e

File tree

1 file changed

+31
-16
lines changed
  • packages/angular_devkit/build_optimizer

1 file changed

+31
-16
lines changed

packages/angular_devkit/build_optimizer/BUILD

Lines changed: 31 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,43 @@
66
licenses(["notice"]) # MIT
77

88
load("//tools:defaults.bzl", "ts_library")
9+
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
910

1011
package(default_visibility = ["//visibility:public"])
1112

1213
ts_library(
13-
name = "lib",
14+
name = "build_optimizer",
1415
srcs = glob(
15-
["**/*.ts"],
16-
# Currently, this library is used only with the rollup plugin.
17-
# To make it simpler for downstream repositories to compile this, we
18-
# neither provide compile-time deps as an `npm_install` rule, nor do we
19-
# expect the downstream repository to install @types/webpack[-*]
20-
# So we exclude files that depend on webpack typings.
16+
include = ["src/**/*.ts"],
2117
exclude = [
22-
"src/build-optimizer/webpack-loader.ts",
23-
"src/purify/**",
24-
"src/index.ts",
25-
"**/*_spec.ts",
26-
"**/*_spec_large.ts",
18+
# TODO(@filipesilva): shouldn't need to exclude the cli files but can't exclude them
19+
# from jasmine_node_test.
20+
"src/**/cli.ts",
21+
"src/**/*_spec.ts",
22+
"src/**/*_spec_large.ts",
23+
"src/**/*_benchmark.ts",
2724
],
2825
),
29-
# Borrow the compile-time deps of the typescript compiler
30-
# Just to avoid an extra npm install action.
31-
node_modules = "@build_bazel_rules_typescript_tsc_wrapped_deps//:node_modules",
32-
tsconfig = "//:tsconfig.json",
26+
deps = [],
3327
)
28+
29+
ts_library(
30+
name = "build_optimizer_test_lib",
31+
srcs = glob(
32+
include = [
33+
"src/**/*_spec.ts",
34+
"src/**/*_spec_large.ts",
35+
],
36+
),
37+
deps = [
38+
":build_optimizer",
39+
"//packages/angular_devkit/core",
40+
# @typings: jasmine
41+
# @typings: node
42+
],
43+
)
44+
45+
jasmine_node_test(
46+
name = "build_optimizer_test",
47+
srcs = [":build_optimizer_test_lib"],
48+
)

0 commit comments

Comments
 (0)