Skip to content

Commit cbbdca9

Browse files
committed
test: fix props related test for types
1 parent ab65f42 commit cbbdca9

File tree

1 file changed

+6
-11
lines changed

1 file changed

+6
-11
lines changed

test-dts/mixins.ts

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -91,23 +91,18 @@ describe('props', () => {
9191

9292
class App extends Props {
9393
mounted() {
94-
type ExpectedProps = Readonly<
95-
{
96-
foo: number
97-
bar: string
98-
} & {
99-
baz?: boolean | undefined
100-
}
101-
>
102-
10394
const vm = this
10495
equals<typeof vm.foo, number>(true)
10596
equals<typeof vm.bar, string>(true)
10697
equals<typeof vm.baz, boolean | undefined>(true)
107-
equals<typeof vm.$props, ExpectedProps>(true)
98+
equals<typeof vm.$props.foo, number | undefined>(true)
99+
equals<typeof vm.$props.bar, string>(true)
100+
equals<typeof vm.$props.baz, boolean | undefined>(true)
108101

109102
// @ts-expect-error
110103
this.nonExist
104+
// @ts-expect-error
105+
this.$props.nonExist
111106
}
112107
}
113108
})
@@ -157,7 +152,7 @@ describe('emits', () => {
157152
class App extends Emits {
158153
mounted() {
159154
const vm = this
160-
equals<typeof vm.$props, {}>(true)
155+
equals<typeof vm.$props, any>(false)
161156
}
162157
}
163158
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy