NuxtN
Nuxt3mo ago
21 replies
Karl

404 path not found in unit test

I am testing a pinia store with persistedStatePlugin in Nuxt env and tests are running green, but I get always this error:


Vitest caught 1 unhandled error during the test run.
This might cause false positive tests. Resolve unhandled errors to make sure your tests are not affected.

FetchError: [POST] "/api/basket/update": 404 Cannot find any path matching /api/basket/update.

I already registerEndpoint:

registerEndpoint('/api/basket/update', {
  method: 'POST', handler: (event) => {
    return ({
      items: [],
      basketId: '123',
    })
  },
})
Was this page helpful?