Module quiz: Testing in Javascript

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

    • Unit testing

    • Integration testing

    • End-to-end testing

  2. When the following test executes, what will the test result be?

     function multiply(a, b) { return a; } expect(multiply(2, 2)).toBe(4);
    
    • Success.

    • Fail.

  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.

    • Unit testing.

    • Integration testing.

  4. What reason would you want to know about your code coverage?

    • It lets you know if you are testing correctly.

    • It lets you know where more testing may be required.

    • 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?

    • Build web application backends

    • Run unit tests

    • Estimate code coverage

    • Download and manage packages

  6. Which of the following are NOT one of the three types of testing?

    • Integration testing

    • End-to-end testing

    • Unit testing

    • Post-hoc testing

  7. Which command is used to install a Node package?

    • package

    • pkg

    • npm

    • node

  8. Which file lists all your application's required node packages?

    • pkg.json

    • node.json

    • package.json

    • 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

    • End-to-end testing

    • Post-hoc testing

    • Integration testing

  10. In Jest you use mocking by employing which of the following?

    • Jest Snapshot

    • Jest Fakes

    • Jest Mock functions

    • External mock libraries