Skip to content

Commit 21a83ba

Browse files
authored
chore: add bazel test rules for the cdk (#9726)
This adds bazel test rules for everything under cdk/ and sets CircleCI Overlay tests don't work because there's not yet a way to pass through flags to the browser. These issues will be addressed in a follow-up PR.
1 parent f2c28b1 commit 21a83ba

22 files changed

+7064
-2863
lines changed

.circleci/config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
# This may be unnecessary once rules_nodejs uses nodejs 8
3737
- run: bazel run @nodejs//:npm run postinstall
3838
- run: bazel build src/...
39+
- run: bazel test src/...
3940
- save_cache:
4041
key: material2-{{ .Branch }}-{{ checksum "package-lock.json" }}
4142
paths:

BUILD.bazel

+54-9
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,67 @@ filegroup(
1414
# TODO(alexeagle): figure out what to do
1515
srcs = glob(["/".join(["node_modules", pkg, "**", ext]) for pkg in [
1616
"@angular",
17-
"jasmine",
18-
"typescript",
19-
"tslib",
20-
"zone.js",
2117
"@types",
22-
"tsickle",
23-
"hammerjs",
24-
"protobufjs",
2518
"bytebuffer",
26-
"reflect-metadata",
19+
"hammerjs",
20+
"jasmine",
2721
"minimist",
2822
"moment",
23+
"protobufjs",
24+
"protractor",
25+
"reflect-metadata",
26+
"tsickle",
27+
"tslib",
28+
"tsutils",
29+
"typescript",
30+
"zone.js",
2931
] for ext in [
3032
"*.js",
3133
"*.json",
3234
"*.d.ts",
33-
]]),
35+
]] + [
36+
"node_modules/http-server/**",
37+
]),
38+
)
39+
40+
41+
# Glob pattern that matches all Angular testing bundles.
42+
ANGULAR_TESTING = [
43+
"node_modules/@angular/*/bundles/*-testing.umd.js",
44+
# The compiler and the dynamic platform-browser should be visible only in tests
45+
"node_modules/@angular/compiler/bundles/*.umd.js",
46+
"node_modules/@angular/platform-browser-dynamic/bundles/*.umd.js",
47+
]
48+
49+
filegroup(
50+
name = "angular_bundles",
51+
srcs = glob(["node_modules/@angular/*/bundles/*.umd.js"], exclude = ANGULAR_TESTING),
52+
)
53+
54+
filegroup(
55+
name = "angular_test_bundles",
56+
testonly = 1,
57+
srcs = glob(ANGULAR_TESTING),
3458
)
3559

60+
filegroup(
61+
name = "tslib_bundle",
62+
testonly = 1,
63+
srcs = glob(["node_modules/tslib/tslib.js"]),
64+
)
65+
66+
# Files necessary for unit tests that use zonejs
67+
filegroup(
68+
name = "web_test_bootstrap_scripts",
69+
# The order of these deps is important.
70+
# Do not sort.
71+
srcs = [
72+
"//:node_modules/reflect-metadata/Reflect.js",
73+
"//:node_modules/zone.js/dist/zone.js",
74+
"//:node_modules/zone.js/dist/async-test.js",
75+
"//:node_modules/zone.js/dist/sync-test.js",
76+
"//:node_modules/zone.js/dist/fake-async-test.js",
77+
"//:node_modules/zone.js/dist/proxy.js",
78+
"//:node_modules/zone.js/dist/jasmine-patch.js",
79+
],
80+
)

0 commit comments

Comments
 (0)