# Module quiz: Testing in Javascript

1. **The idea of having separate, small pieces of code that are easy to test is called what?**
    
    * Post-hoc testing
        
    * <mark>Unit testing</mark>
        
    * Integration testing
        
    * End-to-end testing
        
2. **When the following test executes, what will the test result be?**
    
    ```javascript
    function multiply(a, b) { return a; } expect(multiply(2, 2)).toBe(4);
    ```
    
    * Success.
        
    * <mark>Fail.</mark>
        
3. **Which of the following testing types revolves around the idea of having separate, small pieces of code that are easy to test?**
    
    * End-to-end testing.
        
    * Post-hoc testing.
        
    * <mark>Unit testing.</mark>
        
    * Integration testing.
        
4. **What reason would you want to know about your code coverage?**
    
    * It lets you know if you are testing correctly.
        
    * <mark>It lets you know where more testing may be required.</mark>
        
    * It lets you know if your code is in Javascript.
        
    * It lets you know if you are done writing code.
        
5. `Node.js` **is typically used to do which of the following?**
    
    * <mark>Build web application backends</mark>
        
    * <mark>Run unit tests</mark>
        
    * Estimate code coverage
        
    * <mark>Download and manage packages</mark>
        
6. **Which of the following are <mark>NOT</mark> one of the three types of testing?**
    
    * Integration testing
        
    * End-to-end testing
        
    * Unit testing
        
    * <mark>Post-hoc testing</mark>
        
7. **Which command is used to install a Node package?**
    
    * package
        
    * pkg
        
    * <mark>npm</mark>
        
    * node
        
8. Which file lists all your application's required node packages?
    
    * pkg.json
        
    * node.json
        
    * <mark>package.json</mark>
        
    * npm.json
        
9. **A person on your team wants to help with testing. However, they are not a developer and cannot write code. What type of testing is most suited for them?**
    
    * Unit testing
        
    * <mark>End-to-end testing</mark>
        
    * Post-hoc testing
        
    * Integration testing
        
10. **In Jest you use mocking by employing which of the following?**
    
    * Jest Snapshot
        
    * Jest Fakes
        
    * <mark>Jest Mock functions</mark>
        
    * External mock libraries
