Currently tests written using `waitForAsync` would be prone to Jasmine warnings or errors (depending on the version) for tests incorrectly invoking asynchronous jasmine `done` callbacks multiple times. This can happen because the async test zone logic schedules the `done` callback to be called using `setTimeout`, but this could be invoked multiple times, causing multiple `done` invocations to be scheduled. Most of the issues have been resolved with #45025, but it does not solve the case of multiple tasks finished and callbacks being scheduled. Technically, the current logic is built in way that _should_ result in `_finishCallbackIfDone` and eventually the `done` callback to be invoked at maximium once. This is unfortunately not the case in some rather advanced/unexpected scenarios (like our AngularJS upgrade tests) where the scenario is the following (and microtasks from before the actual `waitForAsync` spec are still completing -- which is valid): ``` 1. A test `beforeEach` schedules a microtask in the ProxyZone. 2. An actual empty `it` spec executes in the AsyncTestZone` (using e.g. `waitForAsync`). 3. The `onInvoke` invokes `_finishCallbackIfDone` because the spec runs synchronously. 4. We wait the scheduled timeout (see below) to account for unhandled promises. 5. The microtask from (1) finishes and `onHasTask` is invoked. --> We register a second `_finishCallbackIfDone` even though we have scheduled a timeout. --> we execute the `done` callback twice because the async zone spec state is "stable" ``` |
||
|---|---|---|
| .circleci | ||
| .devcontainer | ||
| .github | ||
| .husky | ||
| .ng-dev | ||
| .vscode | ||
| .yarn | ||
| aio | ||
| devtools | ||
| docs | ||
| goldens | ||
| integration | ||
| modules | ||
| packages | ||
| scripts | ||
| third_party | ||
| tools | ||
| .bazelignore | ||
| .bazelrc | ||
| .bazelversion | ||
| .clang-format | ||
| .editorconfig | ||
| .gitattributes | ||
| .gitignore | ||
| .gitmessage | ||
| .mailmap | ||
| .npmrc | ||
| .nvmrc | ||
| .prettierrc | ||
| .pullapprove.yml | ||
| .yarnrc | ||
| browser-providers.conf.js | ||
| BUILD.bazel | ||
| CHANGELOG.md | ||
| CHANGELOG_ARCHIVE.md | ||
| CODE_OF_CONDUCT.md | ||
| CONTRIBUTING.md | ||
| gulpfile.js | ||
| karma-js.conf.js | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| renovate.json | ||
| tsconfig-tslint.json | ||
| tslint.json | ||
| WORKSPACE | ||
| yarn.lock | ||
| yarn.lock.readme.md | ||
Angular - The modern web developer's platform.
Angular is a development platform for building mobile and desktop web applications
using Typescript/JavaScript and other languages.
Contributing Guidelines
·
Submit an Issue
·
Blog
Documentation
Get started with Angular, learn the fundamentals and explore advanced topics on our documentation website.
Advanced
Development Setup
Prerequisites
- Install Node.js which includes Node Package Manager
Setting Up a Project
Install the Angular CLI globally:
npm install -g @angular/cli
Create workspace:
ng new [PROJECT NAME]
Run the application:
cd [PROJECT NAME]
ng serve
Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.
Quickstart
Ecosystem
Changelog
Learn about the latest improvements.
Upgrading
Check out our upgrade guide to find out the best way to upgrade your project.
Contributing
Contributing Guidelines
Read through our contributing guidelines to learn about our submission process, coding rules and more.
Want to Help?
Want to report a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.
Code of Conduct
Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.
Community
Join the conversation and help the community.
Love Angular? Give our repo a star ⭐ ⬆️.