angular-cn/packages
George Kalpakas 4e17212d44 test(upgrade): properly clean up after tests to avoid errors in unrelated tests (#28013)
Many `ngUpgrade` tests need to manually [bootstrap modules][1] (instead
of using `TestBed` which automatically cleans up) and thus need to also
manually clean up afterwards (e.g. by calling [destroyPlatform()][2]
after each test).

Failing to destroy the platform is usually not a problem, unless the
next test tries to manually destroy it (as a precaution), as happens
[here][3] (among other places).

More specifically, the problem happens, because (as part of the clean-up
happening on platform destruction) upgraded components will try to
[call a method][4] on `angular.element` after `angular` has been
[set to `undefined`][5] (assuming the last test was using the
[withEachNg1Version()][6] helper).

Because the test order is pseudo-random and thus different on each run,
these errors did not always come up and - when they did- they would go
away after a couple of reruns, making them appear as flakes on CI.

(For reference, the issue was introduced in 43c33d566.)

This commit eliminates the issue by always destroying the platform after
each `ngUpgrade` test.

Jira issue: FW-924

[1]: c3aa24c3f9/packages/upgrade/test/static/test_helpers.ts (L21)
[2]: c3aa24c3f9/packages/upgrade/test/static/integration/upgrade_component_spec.ts (L24)
[3]: c3aa24c3f9/packages/elements/test/create-custom-element_spec.ts (L31)
[4]: c3aa24c3f9/packages/upgrade/src/common/upgrade_helper.ts (L134-L135)
[5]: c3aa24c3f9/packages/upgrade/test/common/test_helpers.ts (L115)
[6]: c3aa24c3f9/packages/upgrade/test/common/test_helpers.ts (L31)

PR Close #28013
2019-01-09 10:27:46 -08:00
..
animations refactor: remove redundant error in catch (#25478) 2019-01-04 15:42:19 -08:00
bazel fix(bazel): protractor utils cannot start server on windows (#27915) 2019-01-07 14:49:44 -08:00
benchpress build: remove "build.sh" script (#27937) 2019-01-07 15:35:09 -08:00
common refactor: remove redundant error in catch (#25478) 2019-01-04 15:42:19 -08:00
compiler fix(ivy): sanitization for Host Bindings (#27939) 2019-01-08 17:17:04 -08:00
compiler-cli fix(ivy): sanitization for Host Bindings (#27939) 2019-01-08 17:17:04 -08:00
core fix(ivy): sanitization for Host Bindings (#27939) 2019-01-08 17:17:04 -08:00
docs refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
elements refactor: remove redundant error in catch (#25478) 2019-01-04 15:42:19 -08:00
examples docs(upgrade): add gotchas/tips/example for multiple downgraded modules (#27217) 2018-12-20 16:20:41 -05:00
forms feat(forms): export NumberValueAccessor & RangeValueAccessor directives (#27743) 2019-01-08 16:36:18 -08:00
http refactor: remove redundant error in catch (#25478) 2019-01-04 15:42:19 -08:00
language-service fix(compiler-cli): create LiteralLikeNode for String and Number literal (#27536) 2018-12-18 13:20:01 -08:00
platform-browser refactor: remove redundant error in catch (#25478) 2019-01-04 15:42:19 -08:00
platform-browser-dynamic test(ivy): root causes update for 'platform-browser-dynamic' and i18n tests (#27972) 2019-01-07 20:27:50 -08:00
platform-server test(ivy): root cause analysis for `@angular/platform-server` (#27800) 2018-12-26 11:17:45 -08:00
platform-webworker fix(ivy): disable test which rely on DebugElement in WebWorker (#27895) 2019-01-04 18:37:31 -08:00
platform-webworker-dynamic build: restrict visibility of npm_package targets (#27611) 2018-12-14 10:20:40 -08:00
private/testing test(ivy): add i18n integration tests via TestBed (#27852) 2019-01-07 14:47:24 -08:00
router fix(ivy): use NgZone.onStable when bootstraped using PlatformRef (#27898) 2019-01-08 14:10:53 -08:00
service-worker refactor: remove redundant error in catch (#25478) 2019-01-04 15:42:19 -08:00
upgrade test(upgrade): properly clean up after tests to avoid errors in unrelated tests (#28013) 2019-01-09 10:27:46 -08:00
BUILD.bazel build(bazel): use fine-grained npm deps (#26111) (#26488) 2018-10-19 20:59:29 -07:00
README.md Revert "docs: Remove unneeded file (#18106)" 2017-07-20 16:46:47 -05:00
empty.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
es6-subset.d.ts build: fix our copy of Array#find typing (#27742) 2018-12-19 15:11:52 -05:00
goog.d.ts test(ivy): add bundling test `todo_i18n` (#27420) 2018-12-04 19:59:12 -08:00
license-banner.txt docs(common): update copyright years (#21232) 2018-01-04 17:45:36 -05:00
rollup.config.js refactor: make all rollup config ES5 compatible (#20028) 2017-10-30 23:09:17 -04:00
system.d.ts refactor: move angular source to /packages rather than modules/@angular 2017-03-08 16:29:27 -08:00
tsconfig-build.json build(bazel): Turning on strictPropertyInitialization for Angular. (#24572) 2018-06-25 07:57:13 -07:00
tsconfig-test.json build: refactor ambient node & jasmine types so they are only included where needed (#25491) 2018-08-16 13:46:43 -07:00
tsconfig.json fix(compiler): Fix look up of entryComponents in AOT Summaries (#24892) 2018-09-11 16:23:17 -07:00
types.d.ts build: refactor ambient node & jasmine types so they are only included where needed (#25491) 2018-08-16 13:46:43 -07:00

README.md

Angular

The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.

License: MIT