Module quiz: Testing :Programming with JavaScript (Meta Front-End Developer Professional Certificate) Answers 2025
1. What is unit testing?
✔️ Unit testing revolves around the idea of having separate, small pieces of code that are easy to test.
❌ Unit testing tests how parts of your system interact with other parts of your system.
❌ Unit testing gives you an efficiency rating for your code measured in units.
❌ Unit testing tries to imitate how a user might interact with your app.
2. When the test executes, what format will the result be?
✔️ Success/Fail
❌ True/False
❌ String
❌ Function
3. Testing type with small, easy-to-test pieces?
✔️ Unit testing
❌ End-to-end testing
❌ Post-hoc testing
❌ Integration testing
4. Why know your code coverage?
✔️ 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 testing correctly.
❌ It lets you know if you are done writing code.
5. Which runtimes are used for building backends?
✔️ Node.js
❌ Jest
❌ Protractor
❌ Cyprus
6. What is integration testing?
✔️ Integration testing tests how parts of your system interact with other parts of your system.
❌ Integration testing revolves around small pieces of code.
❌ Integration testing tests code coverage.
❌ Integration testing imitates user interaction.
7. What is npm used for?
✔️ Use a large number of libraries and frameworks as Node.js modules.
❌ Build a backend.
❌ Test code coverage.
❌ Add code from Stack Overflow or GitHub.
8. What does package.json do?
✔️ Store all the dependencies required for an application.
❌ Store all testing code.
❌ Download npm packages.
❌ Turn your code into an application.
9. True or False: End-to-end tests can be performed in a web browser without writing code.
✔️ True
❌ False
10. In Jest, mocking is done using:
✔️ Jest Mock functions
❌ Jest Snapshot
❌ External mock libraries
❌ Jest Fakes
📊 Summary Table
| Q# | Correct Answer |
|---|---|
| 1 | Unit testing revolves around small pieces of code |
| 2 | Success/Fail |
| 3 | Unit testing |
| 4 | Shows where more testing is required |
| 5 | Node.js |
| 6 | Tests how parts interact with other parts |
| 7 | Use Node.js modules (libraries/frameworks) |
| 8 | Stores application dependencies |
| 9 | True |
| 10 | Jest Mock functions |