Tim Perry

Results 771 comments of Tim Perry

Oh, can you add tests for this please? I think you can base them on any of the other subscription types in here: https://github.com/httptoolkit/mockttp/tree/main/test/integration/subscriptions. You can probably use your ENOTFOUND...

It's not all server errors though - it's only errors during the request handling. There's all sorts of other server errors we can hit in other places, like low-level socket...

> But I have a question. I started to used the ErrorLike type in mockttp-server.ts, but now typedoc is barking This means you need to export the ErrorLike type from...

> Why didn't the other general Node environment variable approaches work? Are those settings overridden by mockttp? Yep, exactly. Those settings set Node's _defaults_, but they don't override all TLS...

Sure! PRs welcome. This should be very quick & easy since the matchers already exist for internal use (defined [here](https://github.com/httptoolkit/mockttp/blob/6941288d9d2c86da5d28b823dc3207b541738a66/src/rules/matchers.ts#L46-L62) and [here](https://github.com/httptoolkit/mockttp/blob/6941288d9d2c86da5d28b823dc3207b541738a66/src/rules/matchers.ts#L162-L230)), it's just that it's not exposed in the...

That's surprising. It sounds like this is caused by some HTTP/2 connection that's staying open. HTTP/2 support is a bit experimental in places, and I can definitely believe that there's...

Hi @jagu-sayan, can you share the full 'open handles' error from Jest, and some code to reproduce what you're seeing, as in the original description above?

@matAlmeida can you share a complete repo or some other directly runnable demo to reproduce this? I'm not sure how to set up Jest etc to run the code shown...

Ah, right, it's failing here: https://github.com/szmarczak/http2-wrapper/blob/51eeaf59ff9344fb192b092241bfda8506983620/source/utils/js-stream-socket.js#L6. This is run on import of that module, not when HTTP/2 is actually used, which is why the options don't matter. It's just caused...

Hi @nazarhussain. To be honest, this isn't well supported, but I think it should be possible for simple cases using [`thenStream`](https://httptoolkit.github.io/mockttp/classes/RequestRuleBuilder.html#thenStream). Does that work for you? If not, can you...