Skip to content

setup() is ran twice when used with localVue and @vue/composition-api #1799

Open
@posva

Description

@posva

Steps to reproduce

import { createLocalVue, mount } from '@vue/test-utils'
import VueCompositionAPI, { defineComponent} from '@vue/composition-api'

  it.only('what', async () => {
    const localVue = createLocalVue()
    localVue.use(VueCompositionAPI)
    let n = 0
    const Component = defineComponent({
      render: (h) => h('p'),
      setup() {
        console.log('setup', n++)
      },
    })

    mount(Component, { localVue })
  })

Expected behaviour

One log

Actual behaviour

logs twice and increments n twice

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions