Skip to content
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

test: add miniflare environment regression test #1840

Merged
merged 2 commits into from
Nov 8, 2023

Conversation

mattcosta7
Copy link
Contributor

@mattcosta7 mattcosta7 commented Nov 7, 2023

This was a failing test for the miniflare environment as discussed in #1834

Now that related changes to interceptors and cookies have shipped, and we have upgraded versions this test is green, and provides a regression check on future changes

The original error was something like this:

❯ test/node/regressions/miniflare.node.test.ts (2 tests | 2 failed) 61ms
❯ test/node/regressions/miniflare.node.test.ts > returns a mocked response to an "http.get" request
→ Failed to get the 'credentials' property on 'Request': the property is not implemented.
❯ test/node/regressions/miniflare.node.test.ts > returns a mocked response to an "http.request" request
→ Failed to get the 'credentials' property on 'Request': the property is not implemented.

@@ -0,0 +1,75 @@
/**
Copy link
Contributor Author

@mattcosta7 mattcosta7 Nov 7, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is a copy of other tests for now, but may get further scoped in the future, or w can write a small cloudflare handler to validate (which would be ideal).

For now, this just throws on the property access we expect it to, a least

@kettanaito
Copy link
Member

Just tested this with #1845 and updated @mswjs/interceptors and the tests are passing:

 ✓ test/node/regressions/miniflare.node.test.ts (2)
   ✓ returns a mocked response to an "http.get" request
   ✓ returns a mocked response to an "http.request" request

🎉

@mattcosta7 mattcosta7 force-pushed the failing-miniflare-test branch from 054e2bf to c93e93e Compare November 8, 2023 14:35
@kettanaito
Copy link
Member

kettanaito commented Nov 8, 2023

Updated the branch. Waiting for the tests to pass...

Edit: Looks like we pushed the merge commit at the exact same time, @mattcosta7! :D That's fun.

@mattcosta7 mattcosta7 marked this pull request as ready for review November 8, 2023 14:36
@mattcosta7 mattcosta7 changed the title chore: failing minflare test test: add miniflare environment regression test Nov 8, 2023
@mattcosta7
Copy link
Contributor Author

Updated the branch. Waiting for the tests to pass...

Edit: Looks like we pushed the merge commit at the exact same time, @mattcosta7! :D That's fun.

oh nice! I realized that I had a different version of the lock file checked in, so downgraded pnpm locally and repushed that too

@kettanaito kettanaito merged commit 15e3006 into main Nov 8, 2023
9 checks passed
@kettanaito kettanaito deleted the failing-miniflare-test branch November 8, 2023 14:57
@kettanaito
Copy link
Member

@mattcosta7, you are once again, a true wizard. Thank you so much.

@kettanaito
Copy link
Member

Released: v2.0.5 🎉

This has been released in v2.0.5!

Make sure to always update to the latest version (npm i msw@latest) to get the newest features and bug fixes.


Predictable release automation by @ossjs/release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants