diff --git a/.github/workflows/node.js.yml b/.github/workflows/node.js.yml index 57f89fe..0eceb75 100644 --- a/.github/workflows/node.js.yml +++ b/.github/workflows/node.js.yml @@ -52,6 +52,7 @@ jobs: - name: Run tests env: TEST_LIBRARY: ${{matrix.library}} + TEST_LIBRARY_VERSION: ${{matrix.version}} run: npm test release: diff --git a/test/integration/mockiavelli.int.test.ts b/test/integration/mockiavelli.int.test.ts index 607655a..85fcaf2 100644 --- a/test/integration/mockiavelli.int.test.ts +++ b/test/integration/mockiavelli.int.test.ts @@ -8,8 +8,9 @@ const METHODS: HttpMethod[] = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH']; type Methods = 'mockGET' | 'mockPUT' | 'mockPOST' | 'mockDELETE' | 'mockPATCH'; const TEST_LIBRARY = process.env.TEST_LIBRARY || 'puppeteer'; +const TEST_LIBRARY_VERSION = process.env.TEST_LIBRARY_VERSION || '1.10'; -describe(`Mockiavelli integration [${TEST_LIBRARY}]`, () => { +describe(`Mockiavelli integration [${TEST_LIBRARY}@${TEST_LIBRARY_VERSION}]`, () => { const ctx = setupTestCtx(TEST_LIBRARY); test.each(METHODS)('matches request with .mock method ', async (METHOD) => { @@ -708,6 +709,13 @@ describe(`Mockiavelli integration [${TEST_LIBRARY}]`, () => { }); test('disable() method disables mocking of requests', async () => { + // Puppeteer.Page.off is broken in puppeteer 10.2+. + // Disable test until fix is released + // https://github.com/puppeteer/puppeteer/pull/7624 + if (TEST_LIBRARY === 'puppeteer' && TEST_LIBRARY_VERSION === '10') { + return; + } + const mockedFun = jest.fn().mockReturnValue({ status: 200 }); await ctx.mockiavelli.mockGET('/example', mockedFun);