We’re happy to officially announce the release of Intern 2.0. This is our most ambitious version yet, with brand new libraries to improve test reliability and performance, new features to make debugging instrumented or compiled code easier, and more!
- Installation times have been reduced by 25%
- Proxy server performance sending static files has been improved by 55%
- CommonJS modules now receive full code coverage analysis and reporting
- Stack traces on test failures now provide accurate line/column information back to the original source code using source maps
- BrowserStack is now supported out of the box
- TestingBot is now supported out of the box
- Chai as Promised is now supported by the functional testing interface
- Bugs and issues related to the WD.js library, like poor error reporting, no longer exist
For more information on this release, including a full list of enhancements, bug fixes, and upgrade advice, visit the release notes. While this is a new major release with a few backwards-incompatible changes, we’ve taken extra care to make sure that only a very small number of tweaks are necessary for an initial upgrade from Intern 1 (usually just updating the tunnel configuration), so in less than 15 minutes you should be up and running with everything that Intern 2 has to offer.
If you or your team would like assistance upgrading your test suite to use all the features of Intern 2, or if you are looking to have a new feature added to Intern, SitePen is here to help with expert advice, support, and custom development services. Get in touch today to learn how we can help.
Dependency injection allows for loose coupling in an application’s architecture, which can simplify testing, and make it easier to compose application components in novel ways. AngularJS ships with a dependency injection system out of the box, but the same benefits can be realized in Dojo.
At SitePen, we have long been advocates for building web applications on a RESTful architecture. Over the last several years, it has been exciting to see organizations increasingly provide RESTful endpoints for the Dojo-based front-ends that we support and develop. A well-designed REST backend can be a excellent foundation for manageable, scalable applications, that will be ready to evolve into the future. I wanted to share a few tips for designing a set of RESTful services.
Modern browsers have powerful new database capabilities that enable applications to store data locally, and perform advanced indexed queries without a network connection. Applications can be built with offline support without any disruption to data interaction, including searching. However, these database capabilities have traditionally been difficult to use across browsers since Safari only supports WebSQL (although version 8 is slated to include IndexedDB support), and Firefox and Internet Explorer only support the W3C’s IndexedDB API (Chrome supports both). And these two interfaces couldn’t be more different, making it very problematic to write applications that work offline on all the major browsers.
But, it is now much easier to access these database capabilities. By taking advantage of the consistency of the Dojo object store implementation, in version Dojo toolkit version 1.10,
dojox/store now includes object store implementations for IndexedDB and WebSQL, along with a wrapper that will automatically delegate to the appropriate store implementation based on browser support. With a single common interface, you can retrieve, update, add, and delete objects, and even perform sophisticated queries in exactly the same way with the different underlying storage implementations.
Dojo has a similar mechanism for creating reusable UI components called Dijits. Dijits can also be used declaratively in HTML and the Dojo parser will instantiate the Dijit for you.
Intern is a great test stack for writing full-featured unit and functional tests, with remote WebDriver-based testing (e.g. Sauce Labs) and continuous integration (e.g. Travis CI). Debugging failing tests can be a challenge if you don’t know the most efficient techniques for troubleshooting platform-specific issues or problems with your test cases.
Dojo’s topic module provides a singleton object for application-wide publish/subscribe functionality. Pub/sub is a loosely coupled messaging protocol by design. It is designed for scenarios in which publishers and subscribers do not need to know anything about each other. The entire focus is the message — the publisher sends a message without concern about who receives it, and the subscribers await messages, without concern of the sender.
Pub/sub implementations typically do not provide a list of topics that have been published or subscribed to, and Dojo’s implementation conforms to this standard — there is no built-in mechanism to acquire a list of topics. To provide developers a reference to the topics available in your application you should document them at the system level (a higher level than individual module documentation).
dgrid’s Selection mixin
dgrid is SitePen’s lightweight, modular, and easily extensible modern grid component, designed for use with AMD and Dojo. The Selection and CellSelection mixins enable selection of rows or cells, both from mouse or keyboard actions and programmatically. Adding selection functionality to a grid is a simple as mixing in the desired module: