-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests-setup.js
32 lines (27 loc) · 779 Bytes
/
tests-setup.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
const puppeteer = require('puppeteer');
const pti = require('puppeteer-to-istanbul');
const width = 1920;
const height = 1080;
before(async () => {
require('./server.js');
global.browser = await puppeteer.launch({
//headless: false,
args: [
`--window-size=${width},${height}`,
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-accelerated-2d-canvas',
'--disable-gpu'
]
});
global.pti = pti;
});
after(() => {
global.browser.close();
//process.exit(0);
});
// https://pptr.dev/#?product=Puppeteer&version=v3.1.0&show=api-accessibilitysnapshotoptions
//const devices = require('puppeteer/DeviceDescriptors');
//const iPhone = devices['iPhone 6'];
// await page.emulate(iPhone);
// https://github.com/chaijs/chai-http/issues/178 shutdown server