Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
0 votes
3 answers
363 views

Mocking useStorage() using @nuxt/test-utils

The goal is to write a test for a function that uses KV storage, under the hood provided by Nitro, in the Nuxt app. On the client side useStorage() is automatically imported. When writing a test, ...
kotkifotki's user avatar
0 votes
0 answers
82 views

ReferenceError for mocked modules in Vitest

I am just getting started with Vitest in a Nuxt app with Nitro and stuggling to getting the mocking right it seems as I keep getting ReferenceErrors. My spec aims at testing a module in the /server ...
Stf_F's user avatar
  • 1,144
0 votes
3 answers
1k views

How to test a function that uses Nitro's useStorage

I have created a function that allows to manage caching. I use this function to cache the responses to API calls. export const cache = async (key: string, callback: Function) => { const ...
Nicolas Dos Santos's user avatar