Michael Solomon
Michael Solomon
Also, we have this test: ```js it.only('Emits the expected event sequence when aborted immediately after `end`', done => { const scope = nock('http://example.test').get('/').reply() const req = http.request('http://example.test') const emitSpy =...
@kettanaito > this is what would happen if you end the request and then abort it. Nock tests two scenarios (attached above) 1. Frist abort. then end 2. First end,...
Nock has an [extensive testing suite](https://github.com/nock/nock/blob/main/tests/test_abort.js) around the `abort` scenario. I suggest we add Nock's tests "as-is" (as possible) and make them pass. It would help us to find more...
Maybe I'm wrong. I'll reopen if needed
@kettanaito 1. I guess I'm doing something wrong, but this script doesn't print true/false: ```js const { ClientRequestInterceptor } = require('@mswjs/interceptors/ClientRequest') const http = require('http') const interceptor = new ClientRequestInterceptor({...
thanks! ```js const { ClientRequestInterceptor } = require('@mswjs/interceptors/ClientRequest') const http = require('http') const interceptor = new ClientRequestInterceptor({ name: 'my-interceptor', }) interceptor.apply(); interceptor.on('request', ({request}) => { request.respondWith(new Response('hey', { status: 200...
From a quick look, I think this is what nock does: https://github.com/nock/nock/blob/main/lib/playback_interceptor.js#L275-L291
@saurabh-asurion Move to Nock 😉 (Just kidding, we are working hard to replace the Nock underlining interception engine with `@mswjs/interceptors`) I don't think there is a workaround, but I have...
> Is that about right Exactly! > I'm not sure if the fix you're proposing will work either What about manually setting the flags immediately and then unsetting them before...
> so I can only assume it's impossible to have request body-based mocks in Nock. I was wrong. Nock has [body filtering](https://github.com/nock/nock#specifying-request-body). > We effectively introduce a duplicate state this...