Skip to content

Commit c06c874

Browse files
wip(tests): handle DEV env variable to ease test creation (run non-headless & no jest timeout)
1 parent 5ec7183 commit c06c874

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

tests/testsTools.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ const mime = require('mime-types');
55

66
const local = new URL('http://local/');
77

8+
// call: DEV=1 yarn run tests
9+
// place before page.close: await new Promise(() => {});
10+
//
11+
const isDev = !!JSON.parse(process.env.DEV ?? 0);
12+
13+
if ( isDev )
14+
jest.setTimeout(1e9);
15+
16+
817
async function createPage({ files, processors= {}}) {
918

1019
async function getFile(url) {
@@ -79,7 +88,7 @@ beforeAll(async () => {
7988
return browser;
8089

8190
browser = await puppeteer.launch({
82-
headless: true,
91+
headless: !isDev,
8392
pipe: true,
8493
args: [
8594
'--incognito',

0 commit comments

Comments
 (0)