Skip to content

Commit

Permalink
test: fix script setup directive test
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jun 28, 2021
1 parent 211793d commit fd7fa6f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ exports[`SFC compile <script setup> inlineTemplate mode referencing scope compon
import ChildComp from './Child.vue'
import SomeOtherComp from './Other.vue'
import myDir from './my-dir'
import vMyDir from './my-dir'
export default {
setup(__props) {
Expand All @@ -313,7 +313,7 @@ export default {
return (_ctx, _cache) => {
return (_openBlock(), _createBlock(_Fragment, null, [
_withDirectives(_createVNode(\\"div\\", null, null, 512 /* NEED_PATCH */), [
[_unref(myDir)]
[_unref(vMyDir)]
]),
_createVNode(ChildComp),
_createVNode(SomeOtherComp)
Expand Down
4 changes: 2 additions & 2 deletions packages/compiler-sfc/__tests__/compileScript.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ defineExpose({ foo: 123 })
<script setup>
import ChildComp from './Child.vue'
import SomeOtherComp from './Other.vue'
import myDir from './my-dir'
import vMyDir from './my-dir'
</script>
<template>
<div v-my-dir></div>
Expand All @@ -281,7 +281,7 @@ defineExpose({ foo: 123 })
`,
{ inlineTemplate: true }
)
expect(content).toMatch('[_unref(myDir)]')
expect(content).toMatch('[_unref(vMyDir)]')
expect(content).toMatch('_createVNode(ChildComp)')
// kebab-case component support
expect(content).toMatch('_createVNode(SomeOtherComp)')
Expand Down

0 comments on commit fd7fa6f

Please sign in to comment.