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

fix(test): fix mocha compatible issue #1028

Merged
merged 1 commit into from
Mar 14, 2018
Merged

Conversation

JiaLiPassion
Copy link
Collaborator

@JiaLiPassion JiaLiPassion commented Feb 23, 2018

fix angular/angular#22150

in new version of mocha, the code like below

 beforeEach(async(() => {
    TestBed.configureTestingModule({
      declarations: [
        AppComponent
      ],
    }).compileComponents();
  }));

  it(`should have as title 'app'`, async(() => {
    console.log('title app test');
    const fixture = TestBed.createComponent(AppComponent);
    const app = fixture.debugElement.componentInstance;
    expect(app.title).to.equal('app');
  }));

will in the same Mocha.Runner.prototype.run.
so Mocha.Runner.prototype.run will run into ProxyZone instead of rootZone, we need to remove the root zone check, otherwise all mocha test will not begin.

also update mocha to 5.0.1

mhevery
mhevery previously approved these changes Feb 27, 2018
@mhevery
Copy link
Contributor

mhevery commented Feb 27, 2018

can you fix the conflicts?

@JiaLiPassion
Copy link
Collaborator Author

@mhevery , I have rebased, please review.

@mhevery mhevery merged commit c554e9f into angular:master Mar 14, 2018
@JiaLiPassion JiaLiPassion deleted the mocha branch March 15, 2018 06:02
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Testing: Mocha done() stops subsequent tests
3 participants