Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

fix(fakeAsync): fix #1050, should only reset patched Date.now until fakeAsync exit #1051

Merged
merged 3 commits into from
Mar 31, 2018

Conversation

JiaLiPassion
Copy link
Collaborator

@JiaLiPassion JiaLiPassion commented Mar 17, 2018

  1. fix fakeAsync tests not working with lodash debounce #1050
    fakeAsyncTestZone should only resetPatchDate when fakeAsync finish totally, not after onInvoke.
    such as
it('test fakeAsync', fakeAsync(() => {
      const component = TestBed.createComponent(AppComponent).componentInstance;
      tick(100);
}));

in this code, there will be several zone.run call which will reset the patchedDate, and make tick not work properly to get the simulated Date. So we must make sure that the patchedDate not reset until
fakeAsync exit.

  1. temp disable non resolved promise.then feature because it will affect angular current cases.
  2. load async/fakeAsync with Zone.__load_patch.
  3. FakeDate should copy window.Date.prototype to fix Regression: usage of date pipe in template of component tested using fakeAsync makes test fail in 0.8.21 #1064

@JiaLiPassion JiaLiPassion changed the title fix(fakeAsync): fix #1050, work with fakeAsync fix(fakeAsync): fix #1050, should only reset patched Date.now until fakeAsync exit Mar 17, 2018
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

1 similar comment
@googlebot
Copy link

So there's good news and bad news.

👍 The good news is that everyone that needs to sign a CLA (the pull request submitter and all commit authors) have done so. Everything is all good there.

😕 The bad news is that it appears that one or more commits were authored or co-authored by someone other than the pull request submitter. We need to confirm that all authors are ok with their commits being contributed to this project. Please have them confirm that here in the pull request.

Note to project maintainer: This is a terminal state, meaning the cla/google commit status will not change from this state. It's up to you to confirm consent of the commit author(s) and merge this pull request when appropriate.

@mhevery mhevery merged commit e15d735 into angular:master Mar 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
3 participants