diff --git a/test/karma.conf.js b/test/karma.conf.js index 23130246..576787a8 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -9,6 +9,7 @@ 'use strict'; const os = require('os'); +const path = require('path'); const puppeteerBrowsers = require('@puppeteer/browsers'); async function download(browser, version, cacheDir, platform) { @@ -20,11 +21,12 @@ async function download(browser, version, cacheDir, platform) { cacheDir, platform }); + console.error(browser, version, platform, buildId); return buildId; } module.exports = async(config) => { - const cacheDir = process.cwd() + '/browsers'; + const cacheDir = path.join(process.cwd(), 'browsers'); const platform = puppeteerBrowsers.detectBrowserPlatform(); let browsers; @@ -43,6 +45,8 @@ module.exports = async(config) => { } else { browsers = ['chrome', 'firefox']; } + console.error('BROWSERS', browsers); + console.error('HRM1', browsers.includes('chrome'), process.env.CHROME_BIN); let reporters = ['mocha']; if (process.env.CI) { @@ -64,11 +68,14 @@ module.exports = async(config) => { process.env.FIREFOX_BIN = puppeteerBrowsers .computeExecutablePath({browser: 'firefox', buildId, cacheDir, platform}); } + console.error('HRM', browsers.includes('chrome'), process.env.CHROME_BIN); if (browsers.includes('chrome') && !process.env.CHROME_BIN) { + console.log('starting chrome download'); const buildId = await download('chrome', process.env.BVER || 'stable', cacheDir, platform); process.env.CHROME_BIN = puppeteerBrowsers .computeExecutablePath({browser: 'chrome', buildId, cacheDir, platform}); + console.log('done with chrome download', process.env.CHROME_BIN); } let chromeFlags = [