Skip to content

Commit

Permalink
chore: remove duplicate test case
Browse files Browse the repository at this point in the history
  • Loading branch information
edison1105 committed Aug 20, 2024
1 parent 85c5ec4 commit 03c2c6c
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 104 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,60 +147,6 @@ export default /*#__PURE__*/_defineComponent({
return { }
}
})"
`;

exports[`defineProps > w/ extends interface 2`] = `
"import { defineComponent as _defineComponent } from 'vue'
interface Bar extends Foo { y?: number }
interface Props extends Bar {
z: number
y: string
}
interface Foo { x?: number }
export default /*#__PURE__*/_defineComponent({
props: {
z: { type: Number, required: true },
y: { type: String, required: true },
x: { type: Number, required: false }
},
setup(__props: any, { expose: __expose }) {
__expose();
return { }
}
})"
`;

exports[`defineProps > w/ extends intersection Type 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
type Foo = {
x?: number;
};
interface Props extends Foo {
z: number
y: string
}
export default /*#__PURE__*/_defineComponent({
props: {
z: { type: Number, required: true },
y: { type: String, required: true },
x: { type: Number, required: false }
},
setup(__props: any, { expose: __expose }) {
__expose();
return { }
}
Expand Down Expand Up @@ -263,31 +209,6 @@ export default /*#__PURE__*/_defineComponent({
return { }
}
})"
`;

exports[`defineProps > w/ intersection Type 1`] = `
"import { defineComponent as _defineComponent } from 'vue'
type Foo = {
x?: number;
};
type Bar = {
y: string;
};
export default /*#__PURE__*/_defineComponent({
props: {
x: { type: Number, required: false },
y: { type: String, required: true }
},
setup(__props: any, { expose: __expose }) {
__expose();
return { }
}
Expand Down
25 changes: 0 additions & 25 deletions packages/compiler-sfc/__tests__/compileScript/defineProps.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,31 +258,6 @@ const props = defineProps({ foo: String })
})
})

test('w/ extends interface', () => {
const { content, bindings } = compile(`
<script lang="ts">
interface Foo { x?: number }
</script>
<script setup lang="ts">
interface Bar extends Foo { y?: number }
interface Props extends Bar {
z: number
y: string
}
defineProps<Props>()
</script>
`)
assertCode(content)
expect(content).toMatch(`z: { type: Number, required: true }`)
expect(content).toMatch(`y: { type: String, required: true }`)
expect(content).toMatch(`x: { type: Number, required: false }`)
expect(bindings).toStrictEqual({
x: BindingTypes.PROPS,
y: BindingTypes.PROPS,
z: BindingTypes.PROPS
})
})

test('w/ extends intersection type', () => {
const { content, bindings } = compile(`
<script setup lang="ts">
Expand Down

0 comments on commit 03c2c6c

Please sign in to comment.