test(docs-infra): properly report errors if `page.init()` fails/rejects (#28290)

For asynchronous callbacks, this can be done either by calling
`done.fail()` or by returning the promise directly (without requesting a
`done` callback). (Using the latter, because it is shorter.)

PR Close #28290
This commit is contained in:
George Kalpakas 2019-01-23 00:33:41 +02:00 committed by Jason Aden
parent fdc2b0bf77
commit 76144f156c
2 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ describe(browser.baseUrl, () => {
const stripQuery = (url: string) => url.replace(/\?.*$/, '');
const stripTrailingSlash = (url: string) => url.replace(/\/$/, '');
beforeAll(done => page.init().then(done));
beforeAll(() => page.init());
beforeEach(() => browser.waitForAngularEnabled(false));
afterEach(() => browser.waitForAngularEnabled(true));

View File

@ -4,7 +4,7 @@ import { SitePage } from './site.po';
describe(browser.baseUrl, () => {
const page = new SitePage();
beforeAll(done => page.init().then(done));
beforeAll(() => page.init());
beforeEach(() => browser.waitForAngularEnabled(false));
afterEach(() => browser.waitForAngularEnabled(true));