download Chromium only when tests are run

This commit is contained in:
adroitwhiz 2020-01-08 04:18:49 -05:00
parent ec141ff76d
commit fdd02a6bd6
5 changed files with 33 additions and 7 deletions
test/integration

View file

@ -1,8 +1,10 @@
/* global vm, render, Promise */
const puppeteer = require('puppeteer');
const puppeteer = require('puppeteer-core');
const test = require('tap').test;
const path = require('path');
const downloadChromium = require('../helper/download-chromium');
const indexHTML = path.resolve(__dirname, 'index.html');
const testDir = (...args) => path.resolve(__dirname, 'pick-tests', ...args);
@ -19,6 +21,7 @@ const runFile = async (file, action, page, script) => {
// immediately invoked async function to let us wait for each test to finish before starting the next.
(async () => {
await downloadChromium();
const browser = await puppeteer.launch();
const page = await browser.newPage();