Skip to content

Commit f95673d

Browse files
committed
nuxt: add new imported methods
1 parent 2298bd1 commit f95673d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

tests/nuxt.ts

+17
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,17 @@
11
import { runInRepo } from '../utils.ts'
22
import { RunOptions } from '../types.ts'
33

4+
const newMethods = [
5+
'useTemplateRef',
6+
'useId',
7+
'useHost',
8+
'useShadowRoot',
9+
'hydrateOnVisible',
10+
'hydrateOnMediaQuery',
11+
'hydrateOnInteraction',
12+
'hydrateOnIdle',
13+
]
14+
415
export async function test(options: RunOptions) {
516
await runInRepo({
617
...options,
@@ -15,6 +26,12 @@ export async function test(options: RunOptions) {
1526
.replace(/expect\(clientResult\)\.toContain\(`pushScopeId\(.*/, '')
1627
.replace(/expect\(treeshaken\)\.toContain\(`<div \${scopeId}>`\)/, '')
1728
},
29+
'packages/nuxt/src/imports/presets.ts': (content) => {
30+
return content.replace(
31+
`'useTransitionState',`,
32+
`'useTransitionState', ${newMethods.map((m) => `'${m}'`).join(',')}`,
33+
)
34+
},
1835
},
1936
})
2037
}

0 commit comments

Comments
 (0)