Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in mounted hook: "TypeError: this._$element.froalaEditor is not a function" when testing using jest #197

Open
nirajfu3e opened this issue Feb 21, 2022 · 0 comments

Comments

@nirajfu3e
Copy link

I am trying to run a unite test on a component that uses the froala component. Here is my setup:

// jest.setup.js
window.jQuery = require('jquery');
window.$ = require('jquery');

require('froala-editor/js/froala_editor.pkgd.min')

const localVue = createLocalVue();
localVue.use(VueFroala);

I keep getting this error:

[Vue warn]: Error in mounted hook: "TypeError: this._$element.froalaEditor is not a function"

The same setup (actual Vue instead of localVue) works fine outside the the test setup. I have tried using the Vue object rather than localVue but no luck. Also tried to remove window.jQuery = require('jquery'); but that creates other issues - also doesn't work.

Any way we can get this working with jest and vue-test-utils?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant