Closed amprew closed 5 years ago
@MountainDrew System.import
deprecated in webpack@4
and will be remove in webpack@5
, better avoid using this
@evilebottnawi - good to know, thanks! With the alternative being import
(https://whatwg.github.io/loader/#loader-import), would you recommend spyOn(Loader, 'import')
?
@MountainDrew what is spyOn
?
@evilebottnawi - ah my bad. It's just a method to overwrite the implemented function, effectively stubbing it. It checks a number of things like called with/number of times... I was effectively asking which Prototype it is built off?
Happy to close this issue. I guess it's a no need to fix 👍
@MountainDrew Feel free to feedback
It's just a method to overwrite the implemented function, effectively stubbing it. It checks a number of things like called with/number of times
Depends on what tool you use for testing, it is better to check it in the documentation for testing tool.
Expected Behavior
When I spy upon
System.import
like:spyOn(System, 'import').and.returnValue(Promise.resolve('value to be returned'));
and call like this:
System.import('not real route');
I expect to receive:
Promise -> 'value to be returned'
Actual Behavior
when run:
Code
How Do We Reproduce?
Follow expected behavior.