From: Wick Date: Sun, 25 Feb 2024 13:11:04 +0000 (+0800) Subject: test: remove unnecessary code in apiCreateApp tests (#10388) X-Git-Tag: v3.4.20~21 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ede2e3f030cd61c3ed0051ea51b26a6aff83ab94;p=thirdparty%2Fvuejs%2Fcore.git test: remove unnecessary code in apiCreateApp tests (#10388) --- diff --git a/packages/runtime-core/__tests__/apiCreateApp.spec.ts b/packages/runtime-core/__tests__/apiCreateApp.spec.ts index 05e51e43bb..f638633974 100644 --- a/packages/runtime-core/__tests__/apiCreateApp.spec.ts +++ b/packages/runtime-core/__tests__/apiCreateApp.spec.ts @@ -143,10 +143,10 @@ describe('api: createApp', () => { }, setup() { // resolve in setup - const FooBar = resolveComponent('foo-bar') as any + const FooBar = resolveComponent('foo-bar') return () => { // resolve in render - const BarBaz = resolveComponent('bar-baz') as any + const BarBaz = resolveComponent('bar-baz') return h('div', [h(FooBar), h(BarBaz)]) } }, @@ -182,10 +182,10 @@ describe('api: createApp', () => { }, setup() { // resolve in setup - const FooBar = resolveDirective('foo-bar')! + const FooBar = resolveDirective('foo-bar') return () => { // resolve in render - const BarBaz = resolveDirective('bar-baz')! + const BarBaz = resolveDirective('bar-baz') return withDirectives(h('div'), [[FooBar], [BarBaz]]) } }, @@ -350,7 +350,7 @@ describe('api: createApp', () => { const handler = vi.fn((err, instance, info) => { expect(err).toBe(error) - expect((instance as any).count).toBe(count.value) + expect(instance.count).toBe(count.value) expect(info).toBe(`render function`) }) @@ -450,11 +450,6 @@ describe('api: createApp', () => { } const app = createApp(Root) - Object.defineProperty(app.config, 'isNativeTag', { - value: isNativeTag, - writable: false, - }) - app.mount(nodeOps.createElement('div')) expect( `Do not use built-in directive ids as custom directive id: bind`,