问题
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