File Explorer

/var/lang/lib/node_modules/npm/node_modules/undici/docs/docs/best-practices

This explorer reads the filesystem of the server it runs on, so /workspace/user isn't present here. Browsing and the terminal still work against this server's own disk from /.

writing-tests.md648 B · 21 lines
# Writing tests Undici is tuned for a production use case and its default will keepa socket open for a few seconds after an HTTP request is completed toremove the overhead of opening up a new socket. These settings that makesUndici shine in production are not a good fit for using Undici in automatedtests, as it will result in longer execution times. The following are good defaults that will keep the socket open for only 10ms: ```jsimport { request, setGlobalDispatcher, Agent } from 'undici' const agent = new Agent({  keepAliveTimeout: 10, // milliseconds  keepAliveMaxTimeout: 10 // milliseconds}) setGlobalDispatcher(agent)```