fix(nuxt): export refreshCookie (#25635)

This commit is contained in:
Hendrik Heil 2024-02-05 21:25:11 +01:00 committed by GitHub
parent 460e0cfebd
commit 9af0e35ffc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 2 deletions

View File

@ -22,7 +22,7 @@ export { clearError, createError, isNuxtError, showError, useError } from './err
export type { NuxtError } from './error' export type { NuxtError } from './error'
export { useFetch, useLazyFetch } from './fetch' export { useFetch, useLazyFetch } from './fetch'
export type { FetchResult, UseFetchOptions } from './fetch' export type { FetchResult, UseFetchOptions } from './fetch'
export { useCookie } from './cookie' export { useCookie, refreshCookie } from './cookie'
export type { CookieOptions, CookieRef } from './cookie' export type { CookieOptions, CookieRef } from './cookie'
export { prerenderRoutes, useRequestHeaders, useRequestEvent, useRequestFetch, setResponseStatus } from './ssr' export { prerenderRoutes, useRequestHeaders, useRequestEvent, useRequestFetch, setResponseStatus } from './ssr'
export { onNuxtReady } from './ready' export { onNuxtReady } from './ready'

View File

@ -120,6 +120,7 @@ describe('composables', () => {
'preloadPayload', 'preloadPayload',
'preloadRouteComponents', 'preloadRouteComponents',
'reloadNuxtApp', 'reloadNuxtApp',
'refreshCookie',
'useCookie', 'useCookie',
'useFetch', 'useFetch',
'useHead', 'useHead',
@ -625,7 +626,7 @@ describe('callOnce', () => {
const execute = () => callOnce(fn) const execute = () => callOnce(fn)
await Promise.all([execute(), execute(), execute()]) await Promise.all([execute(), execute(), execute()])
expect(fn).toHaveBeenCalledTimes(1) expect(fn).toHaveBeenCalledTimes(1)
const fnSync = vi.fn().mockImplementation(() => { }) const fnSync = vi.fn().mockImplementation(() => { })
const executeSync = () => callOnce(fnSync) const executeSync = () => callOnce(fnSync)
await Promise.all([executeSync(), executeSync(), executeSync()]) await Promise.all([executeSync(), executeSync(), executeSync()])