Skip to content

Commit

Permalink
chore: add bazel test rules for the cdk (#9726)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jelbourn authored Feb 13, 2018
1 parent f2c28b1 commit 21a83ba
Show file tree
Hide file tree
Showing 22 changed files with 7,064 additions and 2,863 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ jobs:
# This may be unnecessary once rules_nodejs uses nodejs 8
- run: bazel run @nodejs//:npm run postinstall
- run: bazel build src/...
- run: bazel test src/...
- save_cache:
key: material2-{{ .Branch }}-{{ checksum "package-lock.json" }}
paths:
Expand Down
63 changes: 54 additions & 9 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -14,22 +14,67 @@ filegroup(
# TODO(alexeagle): figure out what to do
srcs = glob(["/".join(["node_modules", pkg, "**", ext]) for pkg in [
"@angular",
"jasmine",
"typescript",
"tslib",
"zone.js",
"@types",
"tsickle",
"hammerjs",
"protobufjs",
"bytebuffer",
"reflect-metadata",
"hammerjs",
"jasmine",
"minimist",
"moment",
"protobufjs",
"protractor",
"reflect-metadata",
"tsickle",
"tslib",
"tsutils",
"typescript",
"zone.js",
] for ext in [
"*.js",
"*.json",
"*.d.ts",
]]),
]] + [
"node_modules/http-server/**",
]),
)


# Glob pattern that matches all Angular testing bundles.
ANGULAR_TESTING = [
"node_modules/@angular/*/bundles/*-testing.umd.js",
# The compiler and the dynamic platform-browser should be visible only in tests
"node_modules/@angular/compiler/bundles/*.umd.js",
"node_modules/@angular/platform-browser-dynamic/bundles/*.umd.js",
]

filegroup(
name = "angular_bundles",
srcs = glob(["node_modules/@angular/*/bundles/*.umd.js"], exclude = ANGULAR_TESTING),
)

filegroup(
name = "angular_test_bundles",
testonly = 1,
srcs = glob(ANGULAR_TESTING),
)

filegroup(
name = "tslib_bundle",
testonly = 1,
srcs = glob(["node_modules/tslib/tslib.js"]),
)

# Files necessary for unit tests that use zonejs
filegroup(
name = "web_test_bootstrap_scripts",
# The order of these deps is important.
# Do not sort.
srcs = [
"//:node_modules/reflect-metadata/Reflect.js",
"//:node_modules/zone.js/dist/zone.js",
"//:node_modules/zone.js/dist/async-test.js",
"//:node_modules/zone.js/dist/sync-test.js",
"//:node_modules/zone.js/dist/fake-async-test.js",
"//:node_modules/zone.js/dist/proxy.js",
"//:node_modules/zone.js/dist/jasmine-patch.js",
],
)
Loading

0 comments on commit 21a83ba

Please sign in to comment.