InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
The number can be compared using __________. |
|
Answer» The NUMBER can be compared using __________. |
|
| 2. |
For Code Coverage Support Jest requires some additional setup and libr |
|
Answer» For CODE Coverage SUPPORT Jest REQUIRES some ADDITIONAL setup and libraries . |
|
| 3. |
______________ resets all information stored in the mockFn.mock.calls and mockFn.mock.instances arrays. |
|
Answer» ______________ resets all INFORMATION stored in the mockFn.mock.calls and mockFn.mock.instances arrays. |
|
| 4. |
How to install Jest using yarn? |
|
Answer» How to INSTALL Jest using yarn? |
|
| 5. |
______________ matcher matches only undefined. |
|
Answer» ______________ matcher MATCHES only UNDEFINED. |
|
| 6. |
To test a particular function which throws an error when it's called, you can use toThrow. |
|
Answer» To test a particular function which THROWS an error when it's called, you can USE toThrow. |
|
| 7. |
______________ resets all information stored in the mock, including any inital implementation given. |
|
Answer» ______________ resets all INFORMATION STORED in the mock, including any inital implementation GIVEN. |
|
| 8. |
Jest uses ________ and ________ matchers to test a value is with exact equality. |
|
Answer» JEST uses ________ and ________ matchers to TEST a value is with EXACT equality. (1)toBeTruthy, toBeFalsy (2)ToBeEqual , toMatch (3)ToBe , toEqual (4)toBeUndefined, toBeDefined Answer:-(3)ToBe , toEqual |
|
| 9. |
Jest records all calls that have been made during mock function and it is stored in ______________ array. |
|
Answer» Jest RECORDS all CALLS that have been made during MOCK FUNCTION and it is stored in ______________ array. |
|
| 10. |
Snapshot tests are a useful tool whenever you want to make sure your UI does not change unexpectedly. |
|
Answer» Snapshot tests are a useful tool whenever you want to make sure your UI does not CHANGE unexpectedly. |
|
| 11. |
Jest will wait until the ______________ callback is called before finishing the test. |
|
Answer» Jest will WAIT until the ______________ CALLBACK is called before finishing the test. |
|
| 12. |
mockRestore() removes the mock and restores the initial implementation |
|
Answer» mockRestore() removes the MOCK and restores the initial IMPLEMENTATION. |
|
| 13. |
The matcher toContain is used _________. |
|
Answer» The matcher toContain is used _________. |
|
| 14. |
Snapshot Testing is not supported in Jest. |
|
Answer» Snapshot Testing is not SUPPORTED in JEST. |
|
| 15. |
_____ returns the value only once when mock function is called. |
|
Answer» ______________ RETURNS the VALUE only once when mock function is CALLED. |
|
| 16. |
Code coverage tests that how much code is covered under tests. |
|
Answer» CODE coverage TESTS that how MUCH code is covered under tests. (1)TRUE (2)False Answer:-(1)True |
|
| 17. |
When you execute ______________ Code, it will move on to another task before it finishes. |
|
Answer» When you execute ______________ Code, it will MOVE on to another TASK before it finishes. |
|
| 18. |
Jest works well with other testing libraries like ______________. |
|
Answer» Jest works well with other testing libraries LIKE ______________. |
|
| 19. |
Jest is maintained by ______________ . |
|
Answer» Jest is maintained by ______________ . |
|
| 20. |
Jest is a JavaScript unit testing framework. |
|
Answer» Jest is a JAVASCRIPT unit testing FRAMEWORK. |
|
| 21. |
Jest is used to test _____________. |
|
Answer» Jest is used to TEST _____________. |
|
| 22. |
______________ recursively checks every field of an object or array. |
|
Answer» ______________ recursively checks every field of an object or ARRAY. |
|
| 23. |
.mock is a property of mock function, the place where all information about how the function has been called is kept. |
|
Answer» .MOCK is a property of mock function, the place where all information about how the function has been CALLED is kept. |
|
| 24. |
How to run your test in terminal? |
|
Answer» How to run your test in TERMINAL? |
|
| 25. |
Jest supports _____for Isolating functionality into small testable |
|
Answer» Jest SUPPORTS ______________ for Isolating FUNCTIONALITY into small, testable units under test. |
|
| 26. |
mockRestore() works only when mock was created with ______________. |
|
Answer» mockRestore() works only when MOCK was CREATED with ______________. |
|
| 27. |
The Asynchronous code will move on to another task before it finishes. |
|
Answer» The Asynchronous code will MOVE on to another TASK before it finishes. |
|
| 28. |
What is the command to install Jest and the babel-jest? |
|
Answer» What is the COMMAND to INSTALL Jest and the babel-jest? |
|
| 29. |
The below test will pass. |
|
Answer» The below test will pass. |
|