diff --git a/examples/with-jest-jsdom/jest.config.ts b/examples/with-jest-jsdom/jest.config.ts index 8984e62..c4ddbcc 100644 --- a/examples/with-jest-jsdom/jest.config.ts +++ b/examples/with-jest-jsdom/jest.config.ts @@ -11,6 +11,10 @@ export default { // (Optional) Add suppor for TypeScript in Jest. transform: { - '^.+\\.tsx?$': '@swc/jest', + '^.+\\.(js|ts)x?$': '@swc/jest', }, + // Transform ESM-only until-async package. + transformIgnorePatterns: [ + '../../node_modules/.pnpm/(?!(until-async)@)', + ], } satisfies Config diff --git a/examples/with-jest-jsdom/package.json b/examples/with-jest-jsdom/package.json index cac2d58..dd5e43e 100644 --- a/examples/with-jest-jsdom/package.json +++ b/examples/with-jest-jsdom/package.json @@ -10,8 +10,8 @@ "@types/node": "^18", "jest": "^29.5.0", "jest-environment-jsdom": "^29.5.0", - "jest-fixed-jsdom": "^0.0.9", - "msw": "2.11.2", + "jest-fixed-jsdom": "^0.0.11", + "msw": "2.12.10", "ts-node": "^10.9.2", "typescript": "^5.0.4" } diff --git a/examples/with-jest/jest.config.ts b/examples/with-jest/jest.config.ts index a5dd043..477dc78 100644 --- a/examples/with-jest/jest.config.ts +++ b/examples/with-jest/jest.config.ts @@ -4,6 +4,10 @@ export default { rootDir: __dirname, setupFilesAfterEnv: ['/jest.setup.ts'], transform: { - '^.+\\.tsx?$': '@swc/jest', + '^.+\\.(js|ts)x?$': '@swc/jest', }, + // Transform ESM-only until-async package. + transformIgnorePatterns: [ + '../../node_modules/.pnpm/(?!(until-async)@)', + ], } satisfies Config diff --git a/examples/with-jest/package.json b/examples/with-jest/package.json index f7f3fbb..6760b97 100644 --- a/examples/with-jest/package.json +++ b/examples/with-jest/package.json @@ -9,7 +9,7 @@ "@types/jest": "^29.5.1", "@types/node": "^18", "jest": "^29.5.0", - "msw": "2.11.2", + "msw": "2.12.10", "ts-node": "^10.9.2", "typescript": "^5.0.4", "with-angular": "workspace:*", diff --git a/examples/with-karma/package.json b/examples/with-karma/package.json index 3716dda..ebf0d55 100644 --- a/examples/with-karma/package.json +++ b/examples/with-karma/package.json @@ -12,10 +12,10 @@ "karma-mocha-reporter": "^2.2.5", "karma-webpack": "^5.0.0", "mocha": "^10.2.0", - "msw": "2.11.2", + "msw": "2.12.10", "webpack": "^5.81.0" }, "msw": { "workerDirectory": "test" } -} \ No newline at end of file +} diff --git a/examples/with-karma/test/mockServiceWorker.js b/examples/with-karma/test/mockServiceWorker.js index 2eec3ee..daa58d0 100644 --- a/examples/with-karma/test/mockServiceWorker.js +++ b/examples/with-karma/test/mockServiceWorker.js @@ -7,7 +7,7 @@ * - Please do NOT modify this file. */ -const PACKAGE_VERSION = '2.11.2' +const PACKAGE_VERSION = '2.12.10' const INTEGRITY_CHECKSUM = '4db4a41e972cec1b64cc569c66952d82' const IS_MOCKED_RESPONSE = Symbol('isMockedResponse') const activeClientIds = new Set() @@ -205,6 +205,7 @@ async function resolveMainClient(event) { * @param {FetchEvent} event * @param {Client | undefined} client * @param {string} requestId + * @param {number} requestInterceptedAt * @returns {Promise} */ async function getResponse(event, client, requestId, requestInterceptedAt) { diff --git a/examples/with-playwright/app/browser.js b/examples/with-playwright/app/browser.js index f22cae1..4dd03f0 100644 --- a/examples/with-playwright/app/browser.js +++ b/examples/with-playwright/app/browser.js @@ -1,4 +1,4 @@ import { setupWorker } from 'msw/browser' import { handlers } from './handlers' -window.worker = setupWorker(...handlers) +export const worker = setupWorker(...handlers) diff --git a/examples/with-playwright/app/index.html b/examples/with-playwright/app/index.html index 4d7261c..e4c6efc 100644 --- a/examples/with-playwright/app/index.html +++ b/examples/with-playwright/app/index.html @@ -7,9 +7,11 @@ -