esri-karma-tutorial
esri-karma-tutorial copied to clipboard
Show an example of how to mock dependencies
Confusingly, the utility modules used as examples in this tutorial actually would be a good candidates for mocking, b/c they have so few dependencies, yet the tutorial demonstrates how to load and use actual dependencies in unit tests.
In some cases it's hard to mock all dependencies (like when testing widgets, where the average define()
block has about 10+ dependencies from dojo, dijit, esri, etc).
This tutorial may be more useful if it demonstrated how to do one example of testing a widget w/o mocks, and one testing a utility module w/ mocks.