Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

jest.setup.js 322 B

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
  1. import nock from 'nock';
  2. // Disable all real network requests
  3. nock.disableNetConnect();
  4. nock.enableNetConnect('127.0.0.1');
  5. nock.emitter.on('no match', (req) => {
  6. if (!req.host.includes('127.0.0.1') && !req.host.includes('localhost')) {
  7. console.error(`Unexpected HTTP request: ${req.method} ${req.href}`);
  8. }
  9. });
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...