From 9af0e35ffc158cecbb33732aec135a94cf6ebbf0 Mon Sep 17 00:00:00 2001 From: Hendrik Heil Date: Mon, 5 Feb 2024 21:25:11 +0100 Subject: [PATCH] fix(nuxt): export `refreshCookie` (#25635) --- packages/nuxt/src/app/composables/index.ts | 2 +- test/nuxt/composables.test.ts | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/composables/index.ts b/packages/nuxt/src/app/composables/index.ts index f7d6b3be37..92a6960a57 100644 --- a/packages/nuxt/src/app/composables/index.ts +++ b/packages/nuxt/src/app/composables/index.ts @@ -22,7 +22,7 @@ export { clearError, createError, isNuxtError, showError, useError } from './err export type { NuxtError } from './error' export { useFetch, useLazyFetch } from './fetch' export type { FetchResult, UseFetchOptions } from './fetch' -export { useCookie } from './cookie' +export { useCookie, refreshCookie } from './cookie' export type { CookieOptions, CookieRef } from './cookie' export { prerenderRoutes, useRequestHeaders, useRequestEvent, useRequestFetch, setResponseStatus } from './ssr' export { onNuxtReady } from './ready' diff --git a/test/nuxt/composables.test.ts b/test/nuxt/composables.test.ts index b1cfbfedc4..8311939e0f 100644 --- a/test/nuxt/composables.test.ts +++ b/test/nuxt/composables.test.ts @@ -120,6 +120,7 @@ describe('composables', () => { 'preloadPayload', 'preloadRouteComponents', 'reloadNuxtApp', + 'refreshCookie', 'useCookie', 'useFetch', 'useHead', @@ -625,7 +626,7 @@ describe('callOnce', () => { const execute = () => callOnce(fn) await Promise.all([execute(), execute(), execute()]) expect(fn).toHaveBeenCalledTimes(1) - + const fnSync = vi.fn().mockImplementation(() => { }) const executeSync = () => callOnce(fnSync) await Promise.all([executeSync(), executeSync(), executeSync()])