Put in order · Vue.js course · Module 9: Composables & VueUse

Steps for Testing a Composable

Arrange the unit test steps for a composable from preparation to assertion:

Items to put in order

  • Call the composable via withSetup
  • Check assertions (expect)
  • Create the withSetup() helper
  • Mock external dependencies
  • Perform actions (e.g., increment)

You can check the correct answer by solving this task in the CodeWorlds game.