Skip to content

Unable to mock lifecycle hooks #166

@wtho

Description

@wtho

What problem does this feature solve?

The test author is currently not able to remove the lifecycle-hook implementation from components. The hooks are:

  • beforeCreate
  • created
  • beforeMount
  • mounted
  • beforeUpdate
  • updated
  • beforeDestroy
  • destroyed
  • activated
  • deactivated

What does the proposed API look like?

The Mock Object in the options object can be used:

mount(TestedComponent, {
  mocks: {
    mounted() {
      console.log('This is the mocked mounted hook!')
    }
  }
})

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions