From b6f3dfd79604964e0b32adbbc320cafe4f0bba29 Mon Sep 17 00:00:00 2001 From: Alan Agius <17563226+alan-agius4@users.noreply.github.com> Date: Tue, 19 May 2026 08:17:07 +0000 Subject: [PATCH] test(upgrade): exclude unit test files from E2E application sources Exclude `**/*.spec.ts` files from the `srcs` glob of the `full_sources` target. Previously, `module.spec.ts` was compiled as part of the application's main sources because the glob pattern only excluded `**/*_spec.ts` (E2E specs). Consequently, `module.spec.js` was generated and included in the runfiles of the E2E test target, causing the Protractor runner to load and execute it. This failed since the E2E testing runner does not have access to unit testing imports like `@angular/core/testing`. (cherry picked from commit 7390af78b10542f01ef6dc30d78ff7ff34c504e1) --- packages/examples/upgrade/static/ts/full/BUILD.bazel | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/examples/upgrade/static/ts/full/BUILD.bazel b/packages/examples/upgrade/static/ts/full/BUILD.bazel index 470feca3334..c9ec8ae4816 100644 --- a/packages/examples/upgrade/static/ts/full/BUILD.bazel +++ b/packages/examples/upgrade/static/ts/full/BUILD.bazel @@ -6,7 +6,10 @@ create_upgrade_example_targets( name = "full", srcs = glob( ["**/*.ts"], - exclude = ["**/*_spec.ts"], + exclude = [ + "**/*_spec.ts", + "**/*.spec.ts", + ], ), assets = ["styles.css"], e2e_srcs = glob(["e2e_test/*_spec.ts"]),