diff --git a/.github/workflows/e2e-tests.yml b/.github/workflows/e2e-tests.yml index 33c950a1..fdbdeb49 100644 --- a/.github/workflows/e2e-tests.yml +++ b/.github/workflows/e2e-tests.yml @@ -7,7 +7,7 @@ on: jobs: Setup: name: Setup - runs-on: ubuntu-latest + runs-on: ubuntu-22.04 steps: - uses: actions/checkout@v3 - name: Cache node modules diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index b3345342..e55ce18d 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -49,7 +49,7 @@ jobs: continue-on-error: true - if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} name: Upload ESLint report - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: eslint_report.json path: eslint_report.json diff --git a/e2e/specs/browser.test.js b/e2e/specs/browser.test.js index 0170ef6d..4b9f4942 100644 --- a/e2e/specs/browser.test.js +++ b/e2e/specs/browser.test.js @@ -4,7 +4,10 @@ describe( 'Storefront', () => { } ); it( 'should have "built with WooCommerce" footer', async () => { - const footerText = await page.evaluate( () => document.querySelector( 'body' ).innerText ); + const footerText = await page.evaluate( + () => document.querySelector( 'body' ).innerText + ); expect( footerText ).toMatch( 'Built with WooCommerce.' ); + expect( 1 ).toBe( 2 ); } ); } ); diff --git a/package-lock.json b/package-lock.json index bac9da75..6f6ec109 100644 --- a/package-lock.json +++ b/package-lock.json @@ -22,6 +22,7 @@ "cross-env": "7.0.3", "eslint-plugin-import": "2.29.1", "github-label-sync": "2.3.1", + "jest-html-reporters": "^3.1.7", "jest-puppeteer": "10.1.0", "lodash": "4.17.21", "node-wp-i18n": "1.2.7", @@ -35,8 +36,8 @@ "uglify-js": "3.19.3" }, "engines": { - "node": "^20.11.1", - "npm": "9.1.3" + "node": "20.17.0", + "npm": "10.8.2" } }, "node_modules/@ampproject/remapping": { @@ -14044,6 +14045,30 @@ "fsevents": "^2.3.2" } }, + "node_modules/jest-html-reporters": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/jest-html-reporters/-/jest-html-reporters-3.1.7.tgz", + "integrity": "sha512-GTmjqK6muQ0S0Mnksf9QkL9X9z2FGIpNSxC52E0PHDzjPQ1XDu2+XTI3B3FS43ZiUzD1f354/5FfwbNIBzT7ew==", + "dev": true, + "dependencies": { + "fs-extra": "^10.0.0", + "open": "^8.0.3" + } + }, + "node_modules/jest-html-reporters/node_modules/fs-extra": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.1.0.tgz", + "integrity": "sha512-oRXApq54ETRj4eMiFzGnHWGy+zo5raudjuxN0b8H7s/RU2oW0Wvsx9O0ACRN/kRq9E8Vu/ReskGB5o3ji+FzHQ==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=12" + } + }, "node_modules/jest-leak-detector": { "version": "29.7.0", "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-29.7.0.tgz", diff --git a/package.json b/package.json index aa1fa790..6fa0d494 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,17 @@ ], "globals": { "STORE_URL": "http://localhost:8802" - } + }, + "reporters": [ + "default", + [ + "jest-html-reporters", + { + "publicPath": "./artifacts", + "filename": "report.html" + } + ] + ] }, "config": { "wp_org_slug": "storefront", @@ -90,6 +100,7 @@ "eslint-plugin-import": "2.29.1", "github-label-sync": "2.3.1", "jest-puppeteer": "10.1.0", + "jest-html-reporters": "^3.1.7", "lodash": "4.17.21", "node-wp-i18n": "1.2.7", "onchange": "7.1.0",