Skip to content

Commit

Permalink
nuxt: add new imported methods
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Aug 15, 2024
1 parent 2298bd1 commit f95673d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/nuxt.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
import { runInRepo } from '../utils.ts'
import { RunOptions } from '../types.ts'

const newMethods = [
'useTemplateRef',
'useId',
'useHost',
'useShadowRoot',
'hydrateOnVisible',
'hydrateOnMediaQuery',
'hydrateOnInteraction',
'hydrateOnIdle',
]

export async function test(options: RunOptions) {
await runInRepo({
...options,
Expand All @@ -15,6 +26,12 @@ export async function test(options: RunOptions) {
.replace(/expect\(clientResult\)\.toContain\(`pushScopeId\(.*/, '')
.replace(/expect\(treeshaken\)\.toContain\(`<div \${scopeId}>`\)/, '')
},
'packages/nuxt/src/imports/presets.ts': (content) => {
return content.replace(
`'useTransitionState',`,
`'useTransitionState', ${newMethods.map((m) => `'${m}'`).join(',')}`,
)
},
},
})
}

0 comments on commit f95673d

Please sign in to comment.