You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enhancement
Currently their is no canonical way to mock @dojo/shim modules. This is a little annoying when wanting to mock things such as fetch and requires messing with the global.
Perhaps inside our shim modules we can have a wrapper that wraps the shim itself and when a test has flag is enabled provides an additional export that allows you to mutate it.
For example something like:
import fetch, { replace } from '@dojo/framework/shim/fetch'
replace(myMockFetch);
where replace (not attached to the name), is only available with the test has flag. This would allow you to swap the implementation.
The text was updated successfully, but these errors were encountered:
Enhancement
Currently their is no canonical way to mock
@dojo/shim
modules. This is a little annoying when wanting to mock things such asfetch
and requires messing with the global.Perhaps inside our shim modules we can have a wrapper that wraps the shim itself and when a test
has
flag is enabled provides an additional export that allows you to mutate it.For example something like:
where
replace
(not attached to the name), is only available with thetest
has flag. This would allow you to swap the implementation.The text was updated successfully, but these errors were encountered: