- Notifications
You must be signed in to change notification settings - Fork1.1k
chore(site): upgrade msw to 2.0#12597
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
3e0e2e2d385f5341fcf23785522641ccf83b641691c5f758a3c3db52723ccd94c61c01a70d24c8f5748a374f6c4089680d538f1e2d5d8788File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -6,6 +6,7 @@ module.exports = { | ||
| { | ||
| displayName: "test", | ||
| roots: ["<rootDir>"], | ||
| setupFiles: ["./jest.polyfills.js"], | ||
| setupFilesAfterEnv: ["./jest.setup.ts"], | ||
| extensionsToTreatAsEsm: [".ts"], | ||
| transform: { | ||
| @@ -27,8 +28,18 @@ module.exports = { | ||
| ], | ||
| }, | ||
| testEnvironment: "jsdom", | ||
| testEnvironmentOptions: { | ||
| customExportConditions: [""], | ||
| }, | ||
| testRegex: "(/__tests__/.*|(\\.|/)(test|spec))\\.tsx?$", | ||
| testPathIgnorePatterns: [ | ||
| "/node_modules/", | ||
| "/e2e/", | ||
| // TODO: This test is timing out after upgrade a few Jest dependencies | ||
| // and I was not able to figure out why. When running it specifically, I | ||
| // can see many act warnings that may can help us to find the issue. | ||
| "/usePaginatedQuery.test.ts", | ||
ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. @Parkreiner I may need your help with this 🙏 I created a separated issue to not block this one#12598 Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. No worries! Happy to take a look tomorrow after Backstage launch Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. rather than temporarily ignore the file, can we use Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Oh, I didn't realize that was an option. Definitely think we should go with that Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. For some reason, Screen.Recording.2024-03-14.at.14.54.43.movPs: I tried to post a longer video but GH didn't allow me because of the size. Member There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. that's annoying... what happens if you add an empty non-skipped test? ContributorAuthor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. it just hangs... I think there is some weird thing happening on this test 🤔 | ||
| ], | ||
| transformIgnorePatterns: [ | ||
| "<rootDir>/node_modules/@chartjs-adapter-date-fns", | ||
| ], | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| /** | ||
| * Necessary for MSW | ||
| * | ||
| * @note The block below contains polyfills for Node.js globals | ||
| * required for Jest to function when running JSDOM tests. | ||
| * These HAVE to be require's and HAVE to be in this exact | ||
| * order, since "undici" depends on the "TextEncoder" global API. | ||
| * | ||
| * Consider migrating to a more modern test runner if | ||
| * you don't want to deal with this. | ||
| */ | ||
| const { TextDecoder, TextEncoder } = require("node:util"); | ||
| const { ReadableStream } = require("node:stream/web"); | ||
| Object.defineProperties(globalThis, { | ||
| TextDecoder: { value: TextDecoder }, | ||
| TextEncoder: { value: TextEncoder }, | ||
| ReadableStream: { value: ReadableStream }, | ||
| }); | ||
| const { Blob, File } = require("node:buffer"); | ||
| const { fetch, Headers, FormData, Request, Response } = require("undici"); | ||
| Object.defineProperties(globalThis, { | ||
| fetch: { value: fetch, writable: true }, | ||
| Blob: { value: Blob }, | ||
| File: { value: File }, | ||
| Headers: { value: Headers }, | ||
| FormData: { value: FormData }, | ||
| Request: { value: Request }, | ||
| Response: { value: Response }, | ||
| }); |
Uh oh!
There was an error while loading.Please reload this page.