-
Notifications
You must be signed in to change notification settings - Fork 889
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
3e0e2e2
wp: upgrade msw
BrunoQuaresma d385f53
Minor fixes
BrunoQuaresma 41fcf23
Fix polyfill issues and ProxyContext old api usage
BrunoQuaresma 7855226
Fix PortForwardPopoverView tests
BrunoQuaresma 41ccf83
Skip usePaginatedQuery.test
BrunoQuaresma b641691
Merge branch 'main' of https://github.com/coder/coder into bq/upgrade…
BrunoQuaresma c5f758a
Skip usePaginatedQuery test
BrunoQuaresma 3c3db52
Fix fmt
BrunoQuaresma 723ccd9
Fix lint
BrunoQuaresma 4c61c01
fix typo
BrunoQuaresma a70d24c
Remove ynecessary async
BrunoQuaresma 8f5748a
Merge branch 'main' of https://github.com/coder/coder into bq/upgrade…
BrunoQuaresma 374f6c4
Fix metadata stuff
BrunoQuaresma 089680d
Improve type
BrunoQuaresma 538f1e2
Merge branch 'main' of https://github.com/coder/coder into bq/upgrade…
BrunoQuaresma d5d8788
Merge branch 'main' of https://github.com/coder/coder into bq/upgrade…
BrunoQuaresma File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }, | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No worries! Happy to take a look tomorrow after Backstage launch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rather than temporarily ignore the file, can we use
test.failing
on the tests in the file?There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi, https://jestjs.io/docs/api#testskipfailingname-fn-timeout :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For some reason,
describe.skip
ortest.failure
are not working 😢 it just hangs foreverScreen.Recording.2024-03-14.at.14.54.43.mov
Ps: I tried to post a longer video but GH didn't allow me because of the size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The 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 🤔