Explorar el Código

test: remove unnecessary code in apiCreateApp tests (#10388)

Wick hace 2 años
padre
commit
ede2e3f030
Se han modificado 1 ficheros con 5 adiciones y 10 borrados
  1. 5 10
      packages/runtime-core/__tests__/apiCreateApp.spec.ts

+ 5 - 10
packages/runtime-core/__tests__/apiCreateApp.spec.ts

@@ -143,10 +143,10 @@ describe('api: createApp', () => {
       },
       },
       setup() {
       setup() {
         // resolve in setup
         // resolve in setup
-        const FooBar = resolveComponent('foo-bar') as any
+        const FooBar = resolveComponent('foo-bar')
         return () => {
         return () => {
           // resolve in render
           // resolve in render
-          const BarBaz = resolveComponent('bar-baz') as any
+          const BarBaz = resolveComponent('bar-baz')
           return h('div', [h(FooBar), h(BarBaz)])
           return h('div', [h(FooBar), h(BarBaz)])
         }
         }
       },
       },
@@ -182,10 +182,10 @@ describe('api: createApp', () => {
       },
       },
       setup() {
       setup() {
         // resolve in setup
         // resolve in setup
-        const FooBar = resolveDirective('foo-bar')!
+        const FooBar = resolveDirective('foo-bar')
         return () => {
         return () => {
           // resolve in render
           // resolve in render
-          const BarBaz = resolveDirective('bar-baz')!
+          const BarBaz = resolveDirective('bar-baz')
           return withDirectives(h('div'), [[FooBar], [BarBaz]])
           return withDirectives(h('div'), [[FooBar], [BarBaz]])
         }
         }
       },
       },
@@ -350,7 +350,7 @@ describe('api: createApp', () => {
 
 
     const handler = vi.fn((err, instance, info) => {
     const handler = vi.fn((err, instance, info) => {
       expect(err).toBe(error)
       expect(err).toBe(error)
-      expect((instance as any).count).toBe(count.value)
+      expect(instance.count).toBe(count.value)
       expect(info).toBe(`render function`)
       expect(info).toBe(`render function`)
     })
     })
 
 
@@ -450,11 +450,6 @@ describe('api: createApp', () => {
       }
       }
 
 
       const app = createApp(Root)
       const app = createApp(Root)
-      Object.defineProperty(app.config, 'isNativeTag', {
-        value: isNativeTag,
-        writable: false,
-      })
-
       app.mount(nodeOps.createElement('div'))
       app.mount(nodeOps.createElement('div'))
       expect(
       expect(
         `Do not use built-in directive ids as custom directive id: bind`,
         `Do not use built-in directive ids as custom directive id: bind`,