In Jest, to isolate a module from its dependencies for more focused unit testing, you would use ______.
- mock
- stub
- spy
- inject
In Jest, you can use the mock function to isolate a module from its dependencies. This allows you to replace the real dependencies with mock implementations for focused unit testing.
Loading...
Related Quiz
- Which feature in Pug allows for writing reusable and maintainable code?
- How can you ensure the security of file uploads in a web application?
- What does the return statement do in a JavaScript function?
- Which of the following responses to a preflight request will allow a browser to make a cross-origin call to upload a file?
- For processing HTTP requests, Express.js allows defining middleware functions at the application level and ______ level.