]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
test: remove unnecessary code in apiCreateApp tests (#10388)
authorWick <wick.linxunjie@gmail.com>
Sun, 25 Feb 2024 13:11:04 +0000 (21:11 +0800)
committerGitHub <noreply@github.com>
Sun, 25 Feb 2024 13:11:04 +0000 (21:11 +0800)
packages/runtime-core/__tests__/apiCreateApp.spec.ts

index 05e51e43bb6b735f514b4276d15d8e6c98f9277f..f638633974132d3eef367f72d75d30c7e9ace141 100644 (file)
@@ -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`,