2018-09-11 21:11:32 -04:00
|
|
|
load("//tools:defaults.bzl", "jasmine_node_test", "nodejs_binary", "ts_library")
|
2018-02-13 14:26:06 -05:00
|
|
|
|
|
|
|
exports_files(["package.json"])
|
|
|
|
|
|
|
|
# The tests in this package must run in separate targets, since they change
|
|
|
|
# working directory and therefore have mutable global state that causes test
|
|
|
|
# isolation failures.
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "core_spec_lib",
|
|
|
|
testonly = True,
|
|
|
|
srcs = ["core_package.spec.ts"],
|
2018-10-04 16:14:14 -04:00
|
|
|
deps = [
|
|
|
|
"//packages:types",
|
2018-11-27 17:43:47 -05:00
|
|
|
"//packages/private/testing",
|
2021-04-13 13:07:12 -04:00
|
|
|
"@npm//@bazel/runfiles",
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//@types/shelljs",
|
2018-10-04 16:14:14 -04:00
|
|
|
],
|
2018-02-13 14:26:06 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "core_package",
|
|
|
|
srcs = [":core_spec_lib"],
|
|
|
|
data = [
|
|
|
|
"//packages/core:npm_package",
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//@types/shelljs",
|
|
|
|
"@npm//shelljs",
|
2018-02-13 14:26:06 -05:00
|
|
|
],
|
|
|
|
)
|
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "common_spec_lib",
|
|
|
|
testonly = True,
|
|
|
|
srcs = ["common_package.spec.ts"],
|
2018-10-04 16:14:14 -04:00
|
|
|
deps = [
|
|
|
|
"//packages:types",
|
2018-12-25 17:16:56 -05:00
|
|
|
"//packages/private/testing",
|
2021-04-13 13:07:12 -04:00
|
|
|
"@npm//@bazel/runfiles",
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//@types/shelljs",
|
2018-10-04 16:14:14 -04:00
|
|
|
],
|
2018-02-13 14:26:06 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "common_package",
|
|
|
|
srcs = [":common_spec_lib"],
|
2018-10-04 16:14:14 -04:00
|
|
|
data = [
|
|
|
|
"//packages/common:npm_package",
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//shelljs",
|
2018-10-04 16:14:14 -04:00
|
|
|
],
|
2018-02-13 14:26:06 -05:00
|
|
|
)
|
2018-02-28 09:51:40 -05:00
|
|
|
|
|
|
|
ts_library(
|
|
|
|
name = "example_spec_lib",
|
2018-08-14 19:18:26 -04:00
|
|
|
testonly = True,
|
2018-02-28 09:51:40 -05:00
|
|
|
srcs = ["example_package.spec.ts"],
|
2018-10-04 16:14:14 -04:00
|
|
|
deps = [
|
|
|
|
"//packages:types",
|
2021-04-13 13:07:12 -04:00
|
|
|
"@npm//@bazel/runfiles",
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//@types/diff",
|
2018-10-04 16:14:14 -04:00
|
|
|
],
|
2018-02-28 09:51:40 -05:00
|
|
|
)
|
|
|
|
|
|
|
|
jasmine_node_test(
|
|
|
|
name = "example_package",
|
|
|
|
srcs = [":example_spec_lib"],
|
2018-03-15 21:04:34 -04:00
|
|
|
data = [
|
|
|
|
"example_package.golden",
|
2019-09-11 16:21:34 -04:00
|
|
|
"example_with_ts_library_package.golden",
|
2018-03-15 21:04:34 -04:00
|
|
|
"//packages/bazel/test/ng_package/example:npm_package",
|
2019-09-11 16:21:34 -04:00
|
|
|
"//packages/bazel/test/ng_package/example-with-ts-library:npm_package",
|
2018-03-15 21:04:34 -04:00
|
|
|
],
|
2018-12-25 17:16:56 -05:00
|
|
|
# We don't want to run the example_package golden test with Ivy yet. Currently the golden
|
|
|
|
# file is based on non-ivy output and therefore won't work for ngc and Ivy at the same time.
|
|
|
|
# TODO: We should be able to have another golden for ivy-aot as well.
|
|
|
|
tags = ["no-ivy-aot"],
|
2019-02-20 12:54:42 -05:00
|
|
|
deps = ["@npm//diff"],
|
2018-03-15 21:04:34 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
nodejs_binary(
|
|
|
|
name = "example_package.accept",
|
2018-08-14 19:18:26 -04:00
|
|
|
testonly = True,
|
2018-03-15 21:04:34 -04:00
|
|
|
data = [
|
2018-12-25 17:16:56 -05:00
|
|
|
"example_package.golden",
|
2019-09-11 16:21:34 -04:00
|
|
|
"example_with_ts_library_package.golden",
|
2018-12-25 17:16:56 -05:00
|
|
|
":example_spec_lib",
|
2018-03-15 21:04:34 -04:00
|
|
|
"//packages/bazel/test/ng_package/example:npm_package",
|
2019-09-11 16:21:34 -04:00
|
|
|
"//packages/bazel/test/ng_package/example-with-ts-library:npm_package",
|
2019-02-20 12:54:42 -05:00
|
|
|
"@npm//diff",
|
2018-03-15 21:04:34 -04:00
|
|
|
],
|
2019-06-07 16:38:06 -04:00
|
|
|
entry_point = ":example_package.spec.ts",
|
2018-03-15 21:04:34 -04:00
|
|
|
templated_args = ["--accept"],
|
2018-02-28 09:51:40 -05:00
|
|
|
)
|