mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
test: add test for new types_bundle rule from Angular bazel package (#45405)
Adds a little golden test for the new `types_bundle` rule that ensures the rule works at a general level. This rule will be useful for non-APF ESM packages like the Angular compiler-cli (for which we also want to bundle types to make them compatible with TypeScripts ESM type resolution) PR Close #45405
This commit is contained in:
committed by
Andrew Scott
parent
68597bb0ca
commit
dd0fc0f237
@@ -0,0 +1,29 @@
|
||||
load("@build_bazel_rules_nodejs//:index.bzl", "generated_file_test")
|
||||
load("//packages/bazel/src/types_bundle:index.bzl", "types_bundle")
|
||||
load("//tools:defaults.bzl", "ts_library")
|
||||
|
||||
package(default_testonly = True)
|
||||
|
||||
ts_library(
|
||||
name = "test_transitive_lib",
|
||||
srcs = ["transitive_fixture.ts"],
|
||||
)
|
||||
|
||||
ts_library(
|
||||
name = "test_lib",
|
||||
srcs = ["bundle_entry.ts"],
|
||||
deps = [":test_transitive_lib"],
|
||||
)
|
||||
|
||||
types_bundle(
|
||||
name = "bundled_types",
|
||||
entry_point = "bundle_entry.d.ts",
|
||||
output_name = "output_index.d.ts",
|
||||
deps = [":test_lib"],
|
||||
)
|
||||
|
||||
generated_file_test(
|
||||
name = "test",
|
||||
src = "expected_types_bundle.d.ts",
|
||||
generated = ":bundled_types",
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export {transitiveExport} from './transitive_fixture';
|
||||
|
||||
export const hello = 1;
|
||||
@@ -0,0 +1,6 @@
|
||||
export declare const hello = 1;
|
||||
|
||||
|
||||
export declare const transitiveExport = "transitive";
|
||||
|
||||
export { }
|
||||
@@ -0,0 +1,9 @@
|
||||
/**
|
||||
* @license
|
||||
* Copyright Google LLC All Rights Reserved.
|
||||
*
|
||||
* Use of this source code is governed by an MIT-style license that can be
|
||||
* found in the LICENSE file at https://angular.io/license
|
||||
*/
|
||||
|
||||
export const transitiveExport = 'transitive';
|
||||
Reference in New Issue
Block a user