Mocking Polymer imports

半腔热情 提交于 2019-12-23 15:38:11

问题


Is there a reliable way to mock imported dependencies in Polymer (or vanilla web components)?
I checked this question and other resources where they suggest to previously define the mocked custom element.
While this approach will actually mock the custom-element definition, it will not prevent the original dep to be imported later and its scripts executed !
This would surely lead to conflicts, inconsistences, and unwanted code execution where the dependencies do not just merely define an element.

check this as a related topic

来源:https://stackoverflow.com/questions/30618325/mocking-polymer-imports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!