Closed mikicho closed 1 month ago
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('hello')) }); const req = http.get('http://nowhere.com/', res => { console.log('response event'); }) req.end() req.write('foo')
This should throw: Error [ERR_STREAM_WRITE_AFTER_END]: write after end but it succeeds
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
This should throw:
Error [ERR_STREAM_WRITE_AFTER_END]: write after end
but it succeeds