Hello,
I'm seeing the following error when running a unit test on a custom component that has a Syncfusion Dialog inside it.
Error:
FAIL src/components/__tests__/TheWelcome.spec.js [ src/components/__tests__/TheWelcome.spec.js ]
TypeError: Right-hand side of 'instanceof' is not callable
❯ o node_modules/@syncfusion/ej2-vue-base/dist/ej2-vue-base.umd.min.js:28:1565
❯ node_modules/@syncfusion/ej2-vue-base/dist/ej2-vue-base.umd.min.js:28:6347
❯ i node_modules/@syncfusion/ej2-vue-popups/dist/ej2-vue-popups.umd.min.js:37:1058
❯ node_modules/@syncfusion/ej2-vue-popups/dist/ej2-vue-popups.umd.min.js:37:1257
❯ node_modules/@syncfusion/ej2-vue-popups/dist/ej2-vue-popups.umd.min.js:37:1291
❯ node_modules/@syncfusion/ej2-vue-popups/dist/ej2-vue-popups.umd.min.js:37:69
❯ Object.
Is Vitest + Vue3 + Vite a supported configuration for unit tests with Syncfusion?
Here is a repository with a demo to reproduce the error:
https://github.com/Frannsoft/vitest-vite-vue-syncfusion-question
To run unit tests, the 'npm run test:unit' command can be used.
Thanks for your time.
Hello,
There are several versions of node that can be used. I would recommend node 16, but node 18 would also work:
https://github.com/vitejs/vite/issues/9113#issuecomment-1184319357
Thank you and please let me know if have any more questions.
Best,
Jordan
Hello,
Checking in and seeing if there's an update on this.
Best,
Jordan
Hello,
Just checking in and seeing if there's an update on this.
Best,
Jordan
Hello,
Just checking in and seeing if there's an update on this.
Best,
Jordan
Hello,
Just checking in and seeing if there's an update on this.
Best,
Jordan
Hello,
Just checking in and seeing if there's an update on this.
Best,
Jordan
Hi Jordan,
Sorry for the inconvenience caused.
In the vite testing, the vite is taking the umd file of the Syncfusion components but our Syncfusion components umd file has some issues with the vite testing. We have logged a feature request for proving our components to support vite testing. For now, we have prepared a work around utility to change the umd file reference in the vite testing process. Please follow the below steps to utilize this utility.
Utility Script: https://www.syncfusion.com/downloads/support/directtrac/general/ze/syncfusion-vite-test-21028499
|
|
We have added this in your shared sample. Please refer to the below sample.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/vite-test32193474
Please get back to us if you have any queries.
Regards,
Ragunath S
Hello,
Thank you, this helps.
Would you be able to provide a link to the Feature Request so I can follow it?
Best,
Jordan
Hi Jordan,
Please refer to the below feedback link to track the status of this feature.
Please get back to us if you have any queries.