Skip to content

Commit

Permalink
fix(@schematics/angular): assert no error logs in e2e
Browse files Browse the repository at this point in the history
This commit adds an assertion to the e2e test to make sure there are
no error logs emitted by the browser.
  • Loading branch information
kyliau authored and alexeagle committed Jan 15, 2019
1 parent ac740cb commit d2f6d79
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/schematics/angular/e2e/files/src/app.e2e-spec.ts
@@ -1,4 +1,5 @@
import { AppPage } from './app.po';
import { browser, logging } from 'protractor';

describe('workspace-project App', () => {
let page: AppPage;
Expand All @@ -11,4 +12,12 @@ describe('workspace-project App', () => {
page.navigateTo();
expect(page.getTitleText()).toEqual('Welcome to <%= relatedAppName %>!');
});

afterEach(async () => {
// Assert that there are no errors emitted from the browser
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
expect(logs).not.toContain(jasmine.objectContaining({
level: logging.Level.SEVERE,
}));
});
});

0 comments on commit d2f6d79

Please sign in to comment.