diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9939fac1..464b9934 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -175,6 +175,8 @@ jobs: run: npm ci env: PUPPETEER_SKIP_DOWNLOAD: true + # Set up GitHub Actions caching for Wireit. + - uses: google/wireit@f3a3c79c553122e2fe5829eeac7d815326502903 # setup-github-actions-caching/v1 - name: Build packages run: npm run build --workspace @puppeteer-test/test - name: Setup cache for Chrome binary @@ -263,6 +265,8 @@ jobs: run: npm ci env: PUPPETEER_SKIP_DOWNLOAD: true + # Set up GitHub Actions caching for Wireit. + - uses: google/wireit@f3a3c79c553122e2fe5829eeac7d815326502903 # setup-github-actions-caching/v1 - name: Build packages run: npm run build --workspace @puppeteer-test/test - name: Setup cache for Firefox binary diff --git a/.mocharc.cjs b/.mocharc.cjs index 08f4d0f0..15f7718a 100644 --- a/.mocharc.cjs +++ b/.mocharc.cjs @@ -27,4 +27,9 @@ module.exports = { parallel: !!process.env.PARALLEL, timeout: timeout, reporter: process.env.CI ? 'spec' : 'dot', + // This should make mocha crash on uncaught errors. + // See https://github.com/mochajs/mocha/blob/master/docs/index.md#--allow-uncaught. + allowUncaught: true, + // See https://github.com/mochajs/mocha/blob/master/docs/index.md#--async-only--a. + asyncOnly: true, }; diff --git a/test/src/elementhandle.spec.ts b/test/src/elementhandle.spec.ts index e8a94b73..3a8650a7 100644 --- a/test/src/elementhandle.spec.ts +++ b/test/src/elementhandle.spec.ts @@ -690,7 +690,7 @@ describe('ElementHandle specs', function () { Puppeteer.customQueryHandlerNames(); expect(handlerNamesAfterUnregistering.includes('getById')).toBeFalsy(); }); - it('should throw with invalid query names', () => { + it('should throw with invalid query names', async () => { try { Puppeteer.registerCustomQueryHandler('1/2/3', { queryOne: () => { diff --git a/test/src/mocha-utils.ts b/test/src/mocha-utils.ts index b7e3898d..166a3db3 100644 --- a/test/src/mocha-utils.ts +++ b/test/src/mocha-utils.ts @@ -249,10 +249,6 @@ if ( ); } -process.on('unhandledRejection', reason => { - throw reason; -}); - const browserNotClosedError = new Error( 'A manually launched browser was not closed!' );