Skip to content

Commit

Permalink
test: split import usage check tests into dedicated file
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Dec 30, 2023
1 parent f787337 commit 63c3e62
Show file tree
Hide file tree
Showing 4 changed files with 406 additions and 405 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -639,190 +639,6 @@ return { foo, bar, baz, y, z }
}"
`;
exports[`SFC compile <script setup> > dev mode import usage check > TS annotations 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { Foo, Bar, Baz, Qux, Fred } from './x'
const a = 1

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();

function b() {}

return { a, b, get Baz() { return Baz } }
}

})"
`;

exports[`SFC compile <script setup> > dev mode import usage check > attribute expressions 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { bar, baz } from './x'
const cond = true

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();


return { cond, get bar() { return bar }, get baz() { return baz } }
}

})"
`;

exports[`SFC compile <script setup> > dev mode import usage check > components 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { FooBar, FooBaz, FooQux, foo } from './x'
const fooBar: FooBar = 1

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();


return { fooBar, get FooBaz() { return FooBaz }, get FooQux() { return FooQux }, get foo() { return foo } }
}

})"
`;

exports[`SFC compile <script setup> > dev mode import usage check > directive 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { vMyDir } from './x'

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();


return { get vMyDir() { return vMyDir } }
}

})"
`;

exports[`SFC compile <script setup> > dev mode import usage check > dynamic arguments 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { FooBar, foo, bar, unused, baz } from './x'

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();


return { get FooBar() { return FooBar }, get foo() { return foo }, get bar() { return bar }, get baz() { return baz } }
}

})"
`;

exports[`SFC compile <script setup> > dev mode import usage check > js template string interpolations 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { VAR, VAR2, VAR3 } from './x'

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();


return { get VAR() { return VAR }, get VAR3() { return VAR3 } }
}

})"
`;

exports[`SFC compile <script setup> > dev mode import usage check > last tag 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { FooBaz, Last } from './x'

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();


return { get FooBaz() { return FooBaz }, get Last() { return Last } }
}

})"
`;

exports[`SFC compile <script setup> > dev mode import usage check > property access (whitespace) 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { Foo, Bar, Baz } from './foo'

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();


return { get Foo() { return Foo } }
}

})"
`;

exports[`SFC compile <script setup> > dev mode import usage check > property access 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { Foo, Bar, Baz } from './foo'

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();


return { get Foo() { return Foo } }
}

})"
`;

exports[`SFC compile <script setup> > dev mode import usage check > spread operator 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { Foo, Bar, Baz } from './foo'

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();


return { get Foo() { return Foo } }
}

})"
`;

exports[`SFC compile <script setup> > dev mode import usage check > template ref 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { foo, bar, Baz } from './foo'

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();


return { get foo() { return foo }, get bar() { return bar }, get Baz() { return Baz } }
}

})"
`;

exports[`SFC compile <script setup> > dev mode import usage check > vue interpolations 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
import { x, y, z, x$y } from './x'

export default /*#__PURE__*/_defineComponent({
setup(__props, { expose: __expose }) {
__expose();


return { get x() { return x }, get z() { return z }, get x$y() { return x$y } }
}

})"
`;

exports[`SFC compile <script setup> > errors > should allow defineProps/Emit() referencing imported binding 1`] = `
"import { bar } from './bar'
Expand Down
Loading

0 comments on commit 63c3e62

Please sign in to comment.