Skip to content

Commit

Permalink
test: improve autowaiting tests (microsoft#3168)
Browse files Browse the repository at this point in the history
  • Loading branch information
kblok authored Jul 26, 2020
1 parent 98cc9db commit d0b758a
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions test/autowaiting.jest.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,11 @@ describe('Auto waiting', () => {
const messages = [];
server.setRoute('/empty.html?cancel', async (req, res) => { res.end('done'); });
server.setRoute('/empty.html?override', async (req, res) => { messages.push('routeoverride'); res.end('done'); });
await Promise.all([
page.evaluate(`
await page.evaluate(`
window.location.href = "${server.EMPTY_PAGE}?cancel";
window.location.href = "${server.EMPTY_PAGE}?override";
`).then(() => messages.push('evaluate')),
]);
`);
messages.push('evaluate');
expect(messages.join('|')).toBe('routeoverride|evaluate');
});
it('should await navigation when evaluating reload', async({page, server}) => {
Expand Down Expand Up @@ -172,7 +171,6 @@ describe('Auto waiting', () => {
});
it('should work with goto following click', async({page, server}) => {
server.setRoute('/login.html', async (req, res) => {
messages.push('route');
res.setHeader('Content-Type', 'text/html');
res.end(`You are logged in`);
});
Expand Down

0 comments on commit d0b758a

Please sign in to comment.