How to use the puppeteer/utils/ChromiumDownloader.currentPlatform function in puppeteer

To help you get started, we’ve selected a few puppeteer examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mickdekkers / vue-howler / test / karma.conf.js View on Github external
const _ = require('lodash')
const babelConfig = JSON.parse(
  require('fs').readFileSync(`${__dirname}/../.babelrc`)
)

/**
 * Headless Chrome setup
 */
const ChromiumRevision = require('puppeteer/package.json').puppeteer
  .chromium_revision
const Downloader = require('puppeteer/utils/ChromiumDownloader')
const revisionInfo = Downloader.revisionInfo(
  Downloader.currentPlatform(),
  ChromiumRevision
)

process.env.CHROMIUM_BIN = revisionInfo.executablePath

/**
 * Karma config
 */
module.exports = function(config) {
  config.set({
    // browsers: ['ChromiumHeadless'],
    browsers: ['Chrome'],

    frameworks: ['mocha'],

    // this is the entry file for all our tests.