DEV Community

Discussion on: Easily Test Mixins With Jest

Collapse
 
individualit profile image
Artur Neumann • Edited

thank you for the idea. It did not quite work for me exactly the way you have described it, but it game me the clue.
here is what I'm doing

      const Component = {
        render() {}
      }
      const wrapper = shallowMount(Component, {
        mixins: [mixinName]
      })
      expect(wrapper.vm.mixinFunc(inputValue)).toEqual(expectedResult)
Enter fullscreen mode Exit fullscreen mode