Put in order · Vue.js course · Module 12: Testing & Deploy

Mock resolved value

Arrange the syntax for mocking a successful fetch response:

Items to put in order

  • vi.fn()
  • global.fetch =
  • .mockResolvedValue({
  • json: async () => mockData })

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