You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migrate to Angular's spec_bundle for tests. (#6036)
The upcoming upgrade to Angular 13+ introduces a number of
bundling-related problems for our tests and applications. Angular has
developed some internal tooling to help resolve these problems. This
change uses Angular's internal spec_bundle() macro to allow us to
continue to run Karma tests with Angular 13+.
Note: spec_bundle() is Angular-internal and not supported for external
use. We use it at our own risk. Googlers, see the following documents
for background and justification: http://go/angular-bazel-problems,
http://go/tb-oss-bundling.
Our usage of spec_bundle() is largely guided/inspired by the usage in
the angular/components repo. This is the version at HEAD as of
early November:
*
https://github.com/angular/components/blob/871f8f231a7a86a7a0778e345f4d517109c9a357/tools/defaults.bzl
Highlights.
1. Run the following commands to install Angular's build tooling and
Babel and then clean the environment:
* `yarn add
https://github.com/angular/dev-infra-private-build-tooling-builds.git#fb42478534df7d48ec23a6834fea94a776cb89a0
@babel/core@^7.16.12 --dev`
* `yarn run yarn-deduplicate`
* `rm -rf node_modules; bazel clean --expunge; yarn;`
2. Automaticaly rename, at build-time, *test.ts files to *test.spec.ts
files so that they are recognized by spec_bundle() as top-level test
files to be executed. Otherwise they would be ignored and the tests not
executed.
3. Modify our build rules to produce correct compiler output and bundle
them using extract_js_module_output() and spec_bundle().
4. Cleanup files we no longer need. There are a number of shims and
hacks that we needed for compatibility with karma test suite that are
now unnecessary due to how the spec_bundle() tooling works.
0 commit comments