mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
a4f144a366
This will make the test even more useful, as it ensures that we aren't accidentally relying on the compiler potentially discovering best guessed modules from other imports that previously were part of the same file (importing all modules as part of the test). PR Close #60503
25 lines
872 B
Python
25 lines
872 B
Python
load("@bazel_skylib//rules:write_file.bzl", "write_file")
|
|
load("//tools:defaults.bzl", "nodejs_test")
|
|
|
|
def module_test(name, npm_packages, skipped_entry_points = [], additional_deps = [], **kwargs):
|
|
write_file(
|
|
name = "%s_config" % name,
|
|
out = "%s_config.json" % name,
|
|
content = [json.encode({
|
|
"packages": [pkg[1] for pkg in npm_packages.items()],
|
|
"skipEntryPoints": skipped_entry_points,
|
|
})],
|
|
)
|
|
|
|
nodejs_test(
|
|
name = "test",
|
|
data = [
|
|
":%s_config" % name,
|
|
"//integration/ng-modules-importability:test_lib",
|
|
] + additional_deps + [pkg[0] for pkg in npm_packages.items()],
|
|
entry_point = "//integration/ng-modules-importability:index.ts",
|
|
enable_linker = True,
|
|
templated_args = ["$(rootpath :%s_config)" % name],
|
|
**kwargs
|
|
)
|