mswjs / source

Generate MSW request handlers from various sources (HAR files, OpenAPI documents, etc).
https://source.mswjs.io
134 stars 5 forks source link

chore: migrate to msw@2 #38

Closed kettanaito closed 3 months ago

kettanaito commented 3 months ago
kettanaito commented 3 months ago

The core has been migrated but tests need rewriting.

weyert commented 3 months ago

Hah, just started working on it today :)

kettanaito commented 3 months ago

@weyert, good call. I think I've already added that with these changes:

https://github.com/mswjs/source/blob/fea871cba982d594c2dcd985bff7dc7c7ac356ae/src/fromTraffic/fromTraffic.ts#L55-L57

kettanaito commented 3 months ago

@weyert, I've removed isEqualBytes in favor of the custom .toEqualBytes() assertion. Let's use that in the tests instead whenever we need to asserting two Uint8Array equality.

kettanaito commented 3 months ago

All fromTraffic tests are passing!

 ✓ test/traffic/fromTraffic.test.ts (7)
 ✓ test/traffic/response-body.test.ts (4)
 ✓ test/traffic/response-order.test.ts (1)
 ✓ test/traffic/response-cookies.test.ts (1)
 ✓ test/traffic/response-stream.test.ts (1)
 ✓ test/traffic/response-timing.test.ts (2) 557ms

Now, to the fromOpenApi tests...

kettanaito commented 3 months ago

The tests are passing and the migration is complete. I will go ahead and merge this.

kettanaito commented 2 months ago

Released: v0.1.0 🎉

This has been released in v0.1.0!

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


Predictable release automation by @ossjs/release.