Skip to content

Commit eb4a23a

Browse files
committed
chore: remove unnecessary casting in tests + use as const
1 parent 8a7f621 commit eb4a23a

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

test-dts/mount.d-test.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -66,11 +66,11 @@ const AppWithProps = {
6666
props: {
6767
a: {
6868
type: String,
69-
required: true as true
69+
required: true
7070
}
7171
},
7272
template: ''
73-
}
73+
} as const
7474

7575
// accept props - vm is properly typed
7676
expectType<string>(
@@ -91,7 +91,7 @@ expectError(
9191
)
9292

9393
const AppWithArrayProps = {
94-
props: ['a'] as ['a'],
94+
props: ['a'],
9595
template: ''
9696
}
9797

@@ -137,7 +137,7 @@ expectError(
137137
mount((props: { a: 1 }) => {}, {
138138
props: {
139139
// @ts-expect-error wrong props
140-
a: '222'
140+
a: '222'
141141
}
142142
})
143143
)

test-dts/shallowMount.d-test.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ const AppWithProps = {
3838
props: {
3939
a: {
4040
type: String,
41-
required: true as true
41+
required: true
4242
}
4343
},
4444
template: ''
45-
}
45+
} as const
4646

4747
// accept props
4848
// vm is properly typed
@@ -65,7 +65,7 @@ expectError(
6565
)
6666

6767
const AppWithArrayProps = {
68-
props: ['a'] as ['a'],
68+
props: ['a'],
6969
template: ''
7070
}
7171

0 commit comments

Comments
 (0)