Skip to content

Commit d2f6d79

Browse files
kyliaualexeagle
authored andcommitted
fix(@schematics/angular): assert no error logs in e2e
This commit adds an assertion to the e2e test to make sure there are no error logs emitted by the browser.
1 parent ac740cb commit d2f6d79

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/schematics/angular/e2e/files/src/app.e2e-spec.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { AppPage } from './app.po';
2+
import { browser, logging } from 'protractor';
23

34
describe('workspace-project App', () => {
45
let page: AppPage;
@@ -11,4 +12,12 @@ describe('workspace-project App', () => {
1112
page.navigateTo();
1213
expect(page.getTitleText()).toEqual('Welcome to <%= relatedAppName %>!');
1314
});
15+
16+
afterEach(async () => {
17+
// Assert that there are no errors emitted from the browser
18+
const logs = await browser.manage().logs().get(logging.Type.BROWSER);
19+
expect(logs).not.toContain(jasmine.objectContaining({
20+
level: logging.Level.SEVERE,
21+
}));
22+
});
1423
});

0 commit comments

Comments
 (0)