Open ofekdeitch-oligo opened 1 year ago
Hi, @ofekdeitch-oligo. Thanks for reporting this.
From my experience, issues like these are often related to how the third-party agent (in your case the testcontainers
package) constructs and performs the request. I can't count the number of times libraries go into strange tropes, sometimes even against the Node.js API, and then issues surface through libraries like MSW, which let you execute more of the request code.
I don't have the time capacity to look into this, so anybody is welcome to debug the issue and share their findings. Thank you for understanding.
Prerequisites
Environment check
msw
versionNode.js version
18.16.0
Reproduction repository
https://github.com/ofekdeitch-oligo/msw-testcontainers-bug
Reproduction steps
run:
nvm use
npm install
npm run test
Notice that there are 2 tests running:
Test (1) passes, but test (2) fails.
I've also added the method
bypassRoutes
that creates routes usingreq.passthrough()
, but test (2) continues to fail.Current behavior
When setting up an MSW server, the
testcontainers
library fails to create a Kafka container.Expected behavior
MSW would bypass the requests that testcontainers relies on, so that a Kafka container would be created successfully.