Skip to content

Commit

Permalink
test: fix and update puppeteer usage
Browse files Browse the repository at this point in the history
  • Loading branch information
iamogbz committed Dec 24, 2024
1 parent d59723a commit ff57f90
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- master
jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -18,7 +18,7 @@ jobs:
node-version-file: .nvmrc
- uses: pnpm/action-setup@v4.0.0
with:
version: 8
version: 9
run_install: |
args: [--shamefully-hoist]
- name: Build
Expand Down
36 changes: 32 additions & 4 deletions src/containers/App/tests/__snapshots__/routes.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@
exports[`Routes matches render snapshot 1`] = `
[
{
"element": <Loadable />,
"element": {
"$$typeof": Symbol(react.transitional.element),
"_owner": null,
"_store": {},
"key": null,
"props": {},
"type": [Function],
},
"exact": true,
"path": "/",
},
Expand All @@ -14,22 +21,43 @@ exports[`Routes matches render snapshot 1`] = `
"path": ":projectName",
},
],
"element": <Loadable />,
"element": {
"$$typeof": Symbol(react.transitional.element),
"_owner": null,
"_store": {},
"key": null,
"props": {},
"type": [Function],
},
"exact": true,
"path": "labs",
},
{
"children": [
{
"element": <Loadable />,
"element": {
"$$typeof": Symbol(react.transitional.element),
"_owner": null,
"_store": {},
"key": null,
"props": {},
"type": [Function],
},
"exact": true,
"path": "emmanuel",
},
],
"path": "profile",
},
{
"element": <Loadable />,
"element": {
"$$typeof": Symbol(react.transitional.element),
"_owner": null,
"_store": {},
"key": null,
"props": {},
"type": [Function],
},
"exact": true,
"path": "profile.emmanuel",
},
Expand Down
6 changes: 5 additions & 1 deletion src/tests/index.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@ import puppeteer from "puppeteer";
jest.setTimeout(15000);
test("React starts successfully", async () => {
// setup
const browser = await puppeteer.launch({ headless: "new" });
const browser = await puppeteer.launch({
disableSetuidSandbox: true,
headless: true,
noSandbox: true,
});
const page = await browser.newPage();
// test
const url = `file:${path.join(__dirname, "../../index.html")}`;
Expand Down

0 comments on commit ff57f90

Please sign in to comment.