I am trying to mock out a plugin that runs on the created() hook inside a jest unit test, however, I keep getting back TypeError: this.$translations is not a function which is causing all my tests to fail with that error:
Inside the Component file:
created () {
this.$translations(this.page.translations)
}
Inside the Test file:
import { translations } from '~/helpers/plugins/translations'
const localVue = createLocalVue()
localVue.use(translations)
const wrapper = shallowMount(TestComponent, {
localVue,
propsData
})
Am I doing something wrong?