const puppeteer = require('puppeteer');
const rollupConfig = require('../rollup.config');

process.env.CHROME_BIN = puppeteer.executablePath();

module.exports = (config) => {
  config.set({
    autoWatch: false,
    basePath: '..',
    browsers: ['ChromeHeadlessWithoutSandbox'],
    client: {
      mocha: {
        timeout: 10000,
      },
    },
    customLaunchers: {
      ChromeHeadlessWithoutSandbox: {
        base: 'ChromeHeadless',
        flags: ['--no-sandbox'],
      },
    },
    files: [
      'dist/cropper.js',
      'dist/cropper.css',
      'test/helpers.js',
      'test/specs/**/*.spec.js',
      {
        pattern: 'docs/images/*',
        included: false,
      },
    ],
    frameworks: ['mocha', 'chai'],
    preprocessors: {
      'test/helpers.js': ['rollup'],
      'test/specs/**/*.spec.js': ['rollup'],
    },
    reporters: ['mocha'],
    rollupPreprocessor: {
      plugins: rollupConfig.plugins,
      output: {
        format: 'iife',
      },
    },
    singleRun: true,
  });
};

@@ -256,30 +256,16 @@
 Headless
-WithoutSandbox
 '%5D,%0A    
@@ -333,150 +333,8 @@
  %7D,%0A
-    customLaunchers: %7B%0A      ChromeHeadlessWithoutSandbox: %7B%0A        base: 'ChromeHeadless',%0A        flags: %5B'--no-sandbox'%5D,%0A      %7D,%0A    %7D,%0A
     

simplify config