Skip to content

Commit

Permalink
test: add tests for vuejs/core#8468
Browse files Browse the repository at this point in the history
  • Loading branch information
so1ve committed Nov 4, 2023
1 parent 610941d commit df8d0a5
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/__fixtures__/core#8468-props.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
type Text = { type: "text"; value: string };
type Number = { type: "number"; value: number };

export type Inputs = Text | Number;
5 changes: 5 additions & 0 deletions test/__fixtures__/core#8468.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<script setup lang="ts" generic="P extends Inputs">
import type { Inputs } from "./core#8468-props.ts";
defineProps<P>();
</script>
23 changes: 23 additions & 0 deletions test/__snapshots__/fixtures-compiled.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,29 @@ export { core_8286 as default };
"
`;

exports[`fixtures compiled > __fixtures__/core#8468.vue 1`] = `
"import { defineComponent } from 'vue';
import _export_sfc from '[NULL]/plugin-vue/export-helper';
\\"use strict\\";
var _sfc_main = /* @__PURE__ */ defineComponent({
__name: \\"core#8468\\",
props: {
type: { type: String, required: true },
value: { type: [String, Number], required: true }
},
setup(__props) {
return () => {
};
}
});
var core_8468 = /* @__PURE__ */ _export_sfc(_sfc_main, [__FILE__]);
export { core_8468 as default };
"
`;

exports[`fixtures compiled > __fixtures__/import-from-vue.vue 1`] = `
"import { defineComponent } from 'vue';
import _export_sfc from '[NULL]/plugin-vue/export-helper';
Expand Down
12 changes: 12 additions & 0 deletions test/__snapshots__/fixtures.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,18 @@ onTransitionstart: any
"
`;
exports[`fixtures > __fixtures__/core#8468.vue 1`] = `
"<script setup lang=\\"ts\\" generic=\\"P extends Inputs\\">
import type { Inputs } from \\"./core#8468-props.ts\\";
defineProps<{
type: \\"number\\" | \\"text\\"
value: string | number
}>();
</script>
"
`;
exports[`fixtures > __fixtures__/import-from-vue.vue 1`] = `
"<script setup lang=\\"ts\\" generic=\\"T extends string\\">
import type { Foo } from \\"./import-from-vue-vue.exclude.vue\\";
Expand Down

0 comments on commit df8d0a5

Please sign in to comment.