From a9a8571e352da37fae957967c6dd43ac67b58da0 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 21 Sep 2022 10:53:38 +0100 Subject: [PATCH] fix(nuxt): export and auto-import `clearNuxtData` (#7710) --- packages/nuxt/src/app/composables/index.ts | 2 +- packages/nuxt/src/imports/presets.ts | 1 + packages/nuxt/test/auto-imports.test.ts | 5 ++++- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/nuxt/src/app/composables/index.ts b/packages/nuxt/src/app/composables/index.ts index d3af737073..98fc038d67 100644 --- a/packages/nuxt/src/app/composables/index.ts +++ b/packages/nuxt/src/app/composables/index.ts @@ -1,5 +1,5 @@ export { defineNuxtComponent } from './component' -export { useAsyncData, useLazyAsyncData, refreshNuxtData } from './asyncData' +export { useAsyncData, useLazyAsyncData, refreshNuxtData, clearNuxtData } from './asyncData' export type { AsyncDataOptions, AsyncData } from './asyncData' export { useHydration } from './hydrate' export { useState } from './state' diff --git a/packages/nuxt/src/imports/presets.ts b/packages/nuxt/src/imports/presets.ts index f1d46bc6e9..26776780ec 100644 --- a/packages/nuxt/src/imports/presets.ts +++ b/packages/nuxt/src/imports/presets.ts @@ -25,6 +25,7 @@ const appPreset = defineUnimportPreset({ 'useAsyncData', 'useLazyAsyncData', 'refreshNuxtData', + 'clearNuxtData', 'defineNuxtComponent', 'useNuxtApp', 'defineNuxtPlugin', diff --git a/packages/nuxt/test/auto-imports.test.ts b/packages/nuxt/test/auto-imports.test.ts index dd30e21785..de4a5c10c4 100644 --- a/packages/nuxt/test/auto-imports.test.ts +++ b/packages/nuxt/test/auto-imports.test.ts @@ -69,7 +69,10 @@ describe('imports:nuxt', () => { }) } } catch (e) { - console.log(e) + it('should import composables', () => { + console.log(e) + expect(false).toBe(true) + }) } })