Wait for static Server to start in tests

This patch starts waiting for Server's listening event
before starting to run any tests.
This commit is contained in:
Andrey Lushnikov
2017-07-06 23:45:18 -07:00
parent c8664319ed
commit bf08dbb3e9
2 changed files with 14 additions and 3 deletions

View File

@@ -30,11 +30,11 @@ describe('Puppeteer', function() {
let staticServer;
let page;
beforeAll(function() {
beforeAll(SX(async function() {
browser = new Browser({args: ['--no-sandbox']});
staticServer = new StaticServer(path.join(__dirname, 'assets'), PORT);
staticServer = await StaticServer.create(path.join(__dirname, 'assets'), PORT);
GoldenUtils.removeOutputDir();
});
}));
afterAll(function() {
staticServer.stop();