From eb4a23a9a0a95bd28b71b8a4cc6983763f19346f Mon Sep 17 00:00:00 2001 From: Evan You Date: Tue, 14 Nov 2023 14:34:08 +0800 Subject: [PATCH] chore: remove unnecessary casting in tests + use as const --- test-dts/mount.d-test.ts | 8 ++++---- test-dts/shallowMount.d-test.ts | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/test-dts/mount.d-test.ts b/test-dts/mount.d-test.ts index c7955bdb5..46c42aa45 100644 --- a/test-dts/mount.d-test.ts +++ b/test-dts/mount.d-test.ts @@ -66,11 +66,11 @@ const AppWithProps = { props: { a: { type: String, - required: true as true + required: true } }, template: '' -} +} as const // accept props - vm is properly typed expectType( @@ -91,7 +91,7 @@ expectError( ) const AppWithArrayProps = { - props: ['a'] as ['a'], + props: ['a'], template: '' } @@ -137,7 +137,7 @@ expectError( mount((props: { a: 1 }) => {}, { props: { // @ts-expect-error wrong props - a: '222' + a: '222' } }) ) diff --git a/test-dts/shallowMount.d-test.ts b/test-dts/shallowMount.d-test.ts index b25cd144d..89fcb6b42 100644 --- a/test-dts/shallowMount.d-test.ts +++ b/test-dts/shallowMount.d-test.ts @@ -38,11 +38,11 @@ const AppWithProps = { props: { a: { type: String, - required: true as true + required: true } }, template: '' -} +} as const // accept props // vm is properly typed @@ -65,7 +65,7 @@ expectError( ) const AppWithArrayProps = { - props: ['a'] as ['a'], + props: ['a'], template: '' }