Skip to content

How to test <img :src="require(...)" /> that used when importing asset to image? #2029

Open
@Frederick-88

Description

@Frederick-88

Hi,
I have quite a simple question, when i try to console.log require('@/assets/images/projects/facebook.png'); it will not return any value. Usually i will try something like expect(image.attributes().src).toBe(require('@/assets/images/projects/facebook.png');) on testing.
Any suggestion? anything would be a great help, thanks =)

P.S - i need this as when i mouseover/mouseleave the image, the src value changes.

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