-
-
Notifications
You must be signed in to change notification settings - Fork 531
Unit testing failure with Jest? #68
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
Comments
|
It looks like at least one other person is running into a similar error with vue-cli: vuejs/vue-cli#951. The issue might be unrelated to vue-pdf specifically, but I'm getting pretty much the same error. |
@cjosh did you solve your issue? I am having a similar issue on the same file. |
@FranckFreiburger I am facing this issue while using vue-pdf with vue-server-renderer. |
@chawlaaditya8 I ended up switching to Karma/Mocha to get the unit tests to work. |
made it work by adding vue-pdf and vue-resize-sensor to my jest config like following jest.config.js
Then also in my my jest config I added a mocks for the worker like explained here wojtekmaj/react-pdf#67 (comment) jest.config.js
create the following file '__mocks__/workerMock.js' in you project and make the path above match it workerMock.js
|
I have the same problem, and the solution above doesn't work for me. EDIT : import pdf from 'vue-pdf'
Vue.component('pdf', pdf) And remove the import and add of component vue-pdf, in this parent. |
Came across the exact same problem. My solution: adding to my jest.config.js:
|
Uh oh!
There was an error while loading. Please reload this page.
My test suite will fail to run if I'm trying to test a component which uses vuepdf. This is with Jest on a project set up with vue-cli:
` ● Test suite failed to run
I don't get this error if I don't import vue-pdf in the component.
The text was updated successfully, but these errors were encountered: