Commit graph

29 commits

Author SHA1 Message Date
Paul Gschwendtner
f0d63f17e2 build: update cross-repo angular dependencies (#56364)
This commit also performs lock file maintenance on all integration
tests, fixing some ambigous ESM/CJS dependency graph issues.

e.g.

```
Unknown error: Error [ERR_REQUIRE_ESM]: require() of ES Module /tmp/ng-integration-test-aTpQOT/test-sandbox/node_modules/string-width/index.js from /tmp/ng-integration-test-aTpQOT/test-sandbox/node_modules/cliui/build/index.cjs not supported.
Instead change the require of index.js in /tmp/ng-integration-test-aTpQOT/test-sandbox/node_modules/cliui/build/index.cjs to a dynamic import() which is available in all CommonJS modules.
------------------------------------------
```

Closes #56261.

PR Close #56364
2024-06-11 12:35:47 -07:00
Angular Robot
3d55073531 build: update cross-repo angular dependencies (#56041)
See associated pull request for more information.

Closes #55806 as a pr takeover

PR Close #56041
2024-05-30 14:53:32 +00:00
Alan Agius
6e1e70d3f1 ci: use application builder for integration tests (#55660)
This updates the integration tests to use the application builder.

PR Close #55660
2024-05-03 11:21:06 -07:00
Alan Agius
46acb55e76 build: update integration tests lock files (#55661)
This should fix CI.

PR Close #55661
2024-05-03 09:17:16 -07:00
Alan Agius
aeb3fe26cf build: remove tslint and codelyzer deps from integration tests (#55658)
These are redundant.

PR Close #55658
2024-05-03 08:15:41 -07:00
Joey Perrott
894c1c5f10 refactor: apply prettier formatting to integration (#54653)
Apply prettier formatting to integration directories

PR Close #54653
2024-04-02 20:42:04 +00:00
Mateusz Daniluk
de777afbc5 refactor: standardize doctype declaration to <!DOCTYPE html> (#51052)
This commit standardizes the doctype declaration across all HTML files in the project to use `<!DOCTYPE html>`

PR Close #51052
2024-02-01 19:29:46 +00:00
cexbrayat
7ba5dc87ed refactor(core): remove test.ts files in integration tests (#52109)
These files are not necessary since CLI v15+

PR Close #52109
2023-10-18 11:52:55 -07:00
Alan Agius
4798ec4166 fix(zone.js): add conditional exports to zone.js package (#51652)
This is needed to better support native ESM modules and avoid the otherwise necessary deep imports like `zone.js/fesm2015/zone-node.js` due to disallowed directory imports.

PR Close #51652
2023-09-06 16:37:26 +00:00
Matthieu Riegler
5d11844a7c docs: update link to the TS config. (#50933)
This TS config doc is now at https://angular.io/guide/typescript-configuration

PR Close #50933
2023-07-05 13:58:35 +02:00
Paul Gschwendtner
78791cea4d build: update browserslist db for integration tests (#50772)
Since we updated the devkit dependencies, we need to update
the browserslist DB versions in integration tests to avoid
browser mismatches causing errors like the following:

```
BrowserslistError: [BABEL] /tmp/ng-integration-test-91jP3g/test-sandbox/node_modules/zone.js/fesm2015/zone.js: Unknown version 114 of edge (While processing: "base$0$0")
```

PR Close #50772
2023-06-20 17:20:50 +02:00
alkavats1
25b6b9788d docs: improved code quality (#50443)
PR Close #50443
2023-05-30 13:00:39 -07:00
Matthieu Riegler
aebf1158f6 ci: Remove environment files and EnableProdMode on integration tests (#49746)
Since v15, prod mode is handled by the CLI with the `optimization` flag. We can remove the environement files and `enableProdMode` when the tests use the CLI.

PR Close #49746
2023-04-14 14:13:33 +00:00
Paul Gschwendtner
63673ddd3f build: re-add lock files for integration tests (#49787)
The lock files for integration tests have been accidentally
removed with: 612eaca3c5

This commit re-adds them.

PR Close #49787
2023-04-11 10:26:42 -07:00
Andrew Scott
34b2d34d5b refactor(router): Remove RouterTestingModule in favor of RouterModule.forRoot (#49427)
`RouterTestingModule` is not needed as of v16. Instead, TestBed
automatically provides `MockPlatformLocation` in order to help test
navigations in the application. The location mocks in the
RouterTestingModule aren't necessary anymore.

There doesn't appear to be any real documentation around
`RouterTestingModule` other than the API docs.

PR Close #49427
2023-04-04 15:12:33 -07:00
Alan Agius
cf98777153 test: update tests to remove deprecated withServerTransition (#49422)
This commit removes the usages of `withServerTransition` form tests.

PR Close #49422
2023-03-15 17:08:18 -07:00
Alan Agius
2d7f48cf74 test: fix misconfiguration in tests (#49391)
Currently, tests are tested twice using "production" like configuration. This commit disabled "optimization" for non production builds.

PR Close #49391
2023-03-15 16:59:50 -07:00
Matthieu Riegler
279e7d4465 refactor: cleanup polyfills by importing zone.js directly in angular.json (#48380)
Since v15, polyfills can be passed directly into angular.json. Let's use this opportunity to reduce the number of unecessary files.

PR Close #48380
2022-12-13 13:37:08 -08:00
Alan Agius
612eaca3c5 build: update cross-repo dependencies to latest stable version (#48216)
With this change we update the cross-repo dependencies to the latest stable version

PR Close #48216
2022-11-29 12:29:46 -08:00
Alan Agius
249384b00c build: update Angular tooling packages to 15.0.0-next.3 (#47584)
- This update is needed to implement the changes in `ng add localize` https://github.com/angular/angular/pull/47569
- Add missing `root` options to all `angular.json`, this is required as otherwise the angular.json validation will fail.
- Remove `require.context` from test.ts integration test, as this is no longer needed.
- Update payloads golden files.

PR Close #47584
2022-09-30 10:53:04 -07:00
Alan Agius
4e8957eb40 test: replace --prod with --configuration production (#46548)
In Angular CLI version 14, the deprecated `--prod` option has been removed.

This is needed to land https://github.com/angular/angular/pull/46545

PR Close #46548
2022-06-28 09:39:05 -07:00
Alan Agius
5ff459e700 test: remove defaultProject workspace option (#45410)
The `defaultProject` workspace option has been deprecated. The project to use will be determined from the current working directory.

See: https://github.com/angular/angular-cli/pull/22852

PR Close #45410
2022-03-24 10:49:57 -07:00
Paul Gschwendtner
2664bc2b3e test: switch integration tests from puppeteer/webdriver-manager to Bazel-managed chromium (#44238)
Switches the integration tests form Puppeteer/webdriver-manager to the
Bazel-managed Chromium/Chromedriver. This is now possible with the new
integration test rule for which we can consult the
`dev-infra/bazel/browsers` toolchain and setup environment variables.
This has been configured already in a previous commit.

This commit also includes some additional small cleanups necessary for
the new integration test rule:

* The `test.sh` scripts have been renamed as they would conflict with
  the `test.sh` scripts generated by the integration test rule.
  Previously this was not an issue because tests were declared at a
  higher-level. As mentioned though this has other downsides and it is
  trivial to rename the file.

* Related to the point above, since tests are now declared witin the
  actual test folder (for perf e.g.), `package.json` files setting
  `"type": "module"` will accidentally cause the `nodejs_test`-generated
  files to be considered ESM. This is not correct and likely needs to be
  fixed upstream in `rules_nodejs` where explicit `.cjs` extensions
  should be used. This is only happening **once** in the `injectable-def`
  test so it is acceptable doing that for now.

PR Close #44238
2021-12-08 13:42:42 -05:00
Paul Gschwendtner
64fd824f67 build: setup test targets for integration tests with new rule (#44238)
Sets up the test targets for integration tests with the new rule.
The targets will match the configuration of the previous integration
test setup (through the dictionary in a `bzl` file).

Note: We already add `setup_chromium` based on whether Chromium tests
run as part of this integration test. In a follow-up commit we can then
remove puppeteer and rely on the Bazel-managed version of Chromium.

PR Close #44238
2021-12-08 13:42:41 -05:00
Alan Agius
b322585256 test: remove document-register-element from elements tests (#43975)
All the [browsers](https://angular.io/guide/browser-support) that Angular supports `CustomElementRegistry` APIs

PR Close #43975
2021-10-29 15:43:55 -07:00
Alan Agius
eb50266b3a test: update browserslist configuration to replace Angular CLI projects (#43417)
With this change we update various browserslist configuration file to match newly generated projects. https://github.com/angular/angular-cli/blob/master/packages/schematics/angular/application/files/.browserslistrc.template

PR Close #43417
2021-09-24 10:49:39 -07:00
George Kalpakas
a4c00c2148 build: upgrade webdriver-manager to v12.1.8 (#40756)
ChromeDriver now supports Apple Silicon ARM processors.
`webdriver-manager` versions 12.1.7 and earlier will, however,
incorrectly download the arm64 ChromeDriver regardless of the
system's architecture. This results in failure to run Protractor tests
on macOS with the error: `spawn Unknown system error -86`

This commit fixes the problem by upgrading `webdriver-manager` to
version 12.1.8, which includes a fix.
See also https://stackoverflow.com/questions/65618558.

PR Close #40756
2021-02-17 06:52:31 -08:00
George Kalpakas
43ecf8a77b feat(platform-server): allow shimming the global env sooner (#40559)
`@angular/platform-server` provides the foundation for rendering an
Angular app on the server. In order to achieve that, it uses a
server-side DOM implementation (currently [domino][1]).

For rendering on the server to work as closely as possible to running
the app on the browser, we need to make DOM globals (such as `Element`,
`HTMLElement`, etc.), which are normally provided by the browser,
available as globals on the server as well.

Currently, `@angular/platform-server` achieves this by extending the
`global` object with the DOM implementation provided by `domino`. This
assignment happens in the [setDomTypes()][2] function, which is
[called in a `PLATFORM_INITIALIZER`][3]. While this works in most cases,
there are some scenarios where the DOM globals are needed sooner (i.e.
before initializing the platform). See, for example, #24551 and #39950
for more details on such issues.

This commit provides a way to solve this problem by exposing a
side-effect-ful entry-point (`@angular/platform-server/init`), that
shims the `global` object with DOM globals. People will be able to
import this entry-point in their server-rendered apps before
bootstrapping the app (for example, in their `main.server.ts` file).
(See also [#39950 (comment)][4].)

In a future update, the [`universal` schematics][5] will include such an
import by default in newly generated projects.

[1]: https://www.npmjs.com/package/domino
[2]: https://github.com/angular/angular/blob/0fc8466f1be392917e0c/packages/platform-server/src/domino_adapter.ts#L17-L21
[3]: https://github.com/angular/angular/blob/0fc8466f1be392917e0c/packages/platform-server/src/server.ts#L33
[4]: https://github.com/angular/angular/issues/39950#issuecomment-747598403
[5]: https://github.com/angular/angular-cli/blob/cc51432661eb4ab4b6a3/packages/schematics/angular/universal

PR Close #40559
2021-02-12 08:55:25 -08:00
George Kalpakas
177eab2260 ci: add integration test for Angular Elemens with SSR (#40559)
This commit adds an integration test that uses `@angular/elements` with
`@angular/platform-server` in order to highlight a current
incompatibility. The issue will be fixed in a subsequent commit.

PR Close #40559
2021-02-12 08:55:25 -08:00