Skip to content

Commit

Permalink
use --no-sandbox flag for puppeteer tests
Browse files Browse the repository at this point in the history
  • Loading branch information
derek-noredink committed Jan 31, 2025
1 parent 9490b0f commit 4f3fcf2
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions script/puppeteer-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@ const httpServer = require("http-server");
const percySnapshot = require("@percy/puppeteer");

const platform = require("os").platform();
// We need to change the args passed to puppeteer based on the platform they're using
const puppeteerArgs = /^win/.test(platform) ? [] : ["--single-process"];
const puppeteerArgs = (
/^win/.test(platform) ? [] : ["--single-process"]
).concat(
// https://stackoverflow.com/questions/50662388/running-headless-chrome-puppeteer-with-no-sandbox
/^linux/.test(platform) ? ["--no-sandbox"] : []
);
const PORT = process.env.PORT_NUMBER || 8000;

const { AxePuppeteer } = require("@axe-core/puppeteer");
Expand Down

0 comments on commit 4f3fcf2

Please sign in to comment.