test: migrate remaining public-api tests to Bazel (#22639)

We now create npm packages to cover all the public api assertions in tools/public_api_guard.
We no longer depend on ts-api-guardian from npm - it is now stale since the repository was archived.
There is no longer a gulp task to enforce or accept the public API, this is in CircleCI as part of running all bazel test targets.

PR Close #22639
This commit is contained in:
Alex Eagle
2018-03-07 11:26:11 -08:00
committed by Kara Erickson
parent b26a90567c
commit 1e6cc42a01
33 changed files with 207 additions and 237 deletions

View File

@ -1,62 +1,26 @@
load("//tools/ts-api-guardian:index.bzl", "ts_api_guardian_test")
[
ts_api_guardian_test(
name = "%s_%s_api" % (
bundle[0],
bundle[1].replace("/", "_"),
),
actual = "packages/%s/npm_package/%s.d.ts" % (
bundle[0],
bundle[1],
),
data = glob([
"%s/**/*.d.ts" % bundle[0],
]) + [
"//packages/%s:npm_package" % bundle[0],
],
golden = "tools/public_api_guard/%s/%s.d.ts" % (
bundle[0],
bundle[1],
),
)
for bundle in [
[
"core",
"core",
],
[
"core",
"testing",
],
[
"common",
"http/testing",
],
[
"common",
"common",
],
[
"common",
"http",
],
[
"common",
"testing",
],
[
"router",
"router",
],
[
"router",
"testing",
],
[
"router",
"upgrade",
],
# TODO(alexeagle): add remaining packages here once they have ng_package's
]
]
[ts_api_guardian_test(
name = "%s_%s_api" % (
bundle[0],
bundle[1].replace("/", "_"),
),
actual = "packages/%s/npm_package/%s.d.ts" % (
bundle[0],
bundle[1],
),
data = glob([
"%s/**/*.d.ts" % bundle[0],
]) + [
"//packages/%s:npm_package" % bundle[0],
],
golden = "tools/public_api_guard/%s/%s.d.ts" % (
bundle[0],
bundle[1],
),
) for bundle in [b[:-len(".d.ts")].split("/", 1) for b in glob(
["**/*.d.ts"],
# The API surface of the compiler is currently unstable - all of the important APIs are exposed
# via @angular/core, @angular/platform-browser or @angular/platform-browser-dynamic instead.
exclude = ["compiler/*"],
)]]