From 4f0fd7bc938f477714f66b2e163a0077a6319e89 Mon Sep 17 00:00:00 2001 From: vinit717 Date: Mon, 14 Oct 2024 16:54:17 +0530 Subject: [PATCH] update: config and workflow file --- .github/workflows/tests.yml | 6 ++---- jest-puppeteer.config.js | 19 ++++++++++--------- 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 4eaab5c7..4a10205f 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -9,9 +9,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - - name: Install Google Chrome - run: | - sudo apt-get update - sudo apt-get install -y google-chrome-stable - run: yarn - run: yarn test + env: + CI: true diff --git a/jest-puppeteer.config.js b/jest-puppeteer.config.js index b6ca7aad..658c4ba7 100644 --- a/jest-puppeteer.config.js +++ b/jest-puppeteer.config.js @@ -5,23 +5,24 @@ const baseOptions = { port: 8000, launchTimeout: 30000, }, + launch: { + args: ['--no-sandbox', '--disable-setuid-sandbox'], + }, }; + const ciPipelineOptions = { launch: { executablePath: '/usr/bin/google-chrome-stable', headless: 'new', args: [ - ...(ci - ? [ - '--ignore-certificate-errors', - '--no-sandbox', - '--disable-setuid-sandbox', - '--disable-dev-shm-usage', - '--disable-gpu', - ] - : ['--enable-gpu']), + '--no-sandbox', + '--disable-setuid-sandbox', + '--ignore-certificate-errors', + '--disable-dev-shm-usage', + '--disable-gpu', ], }, server: baseOptions.server, }; + module.exports = ci ? ciPipelineOptions : baseOptions;