Skip to content

Commit

Permalink
test(core): add a symbols test for renderer2 code
Browse files Browse the repository at this point in the history
  • Loading branch information
matsko committed Apr 18, 2018
1 parent fd48e53 commit 63c5ac2
Show file tree
Hide file tree
Showing 5 changed files with 4,211 additions and 0 deletions.
69 changes: 69 additions & 0 deletions packages/core/test/bundling/hello_world_r2/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
package(default_visibility = ["//visibility:public"])

load("//tools:defaults.bzl", "ts_library", "ng_module")
load("//tools/symbol-extractor:index.bzl", "js_expected_symbol_test")
load("//packages/bazel/src:ng_rollup_bundle.bzl", "ng_rollup_bundle")
load("@build_bazel_rules_nodejs//:defs.bzl", "jasmine_node_test")
load("@build_bazel_rules_typescript//:defs.bzl", "ts_devserver")

ng_module(
name = "hello_world",
srcs = ["index.ts"],
deps = [
"//packages/core",
"//packages/platform-browser-dynamic",
],
)

ng_rollup_bundle(
name = "bundle",
# TODO(alexeagle): This is inconsistent.
# We try to teach users to always have their workspace at the start of a
# path, to disambiguate from other workspaces.
# Here, the rule implementation is looking in an execroot where the layout
# has an "external" directory for external dependencies.
# This should probably start with "angular/" and let the rule deal with it.
entry_point = "packages/core/test/bundling/hello_world_r2/index.js",
deps = [
":hello_world",
"//packages/core",
"//packages/platform-browser-dynamic",
],
)

ts_library(
name = "test_lib",
testonly = 1,
srcs = glob(["*_spec.ts"]),
deps = [
"//packages:types",
"//packages/core/testing",
],
)

jasmine_node_test(
name = "test",
data = [
":bundle",
":bundle.js",
":bundle.min.js.brotli",
":bundle.min_debug.js",
],
deps = [":test_lib"],
)

js_expected_symbol_test(
name = "symbol_test",
src = ":bundle.min_debug.js",
golden = ":bundle.golden_symbols.json",
)

ts_devserver(
name = "devserver",
static_files = [
":bundle.min_debug.js",
":bundle.min.js",
"index.html",
],
deps = [],
)

0 comments on commit 63c5ac2

Please sign in to comment.