4.0.0
Overview
Version 4 is a major update with both internal and user-facing changes. Although Intern's basic functionality and test interfaces are similar to previous versions, Intern 4 is not API-compatible with Intern 3.
Thanks to everyone who contributed issues or code, and especially to those brave souls who've been using the alpha versions through the last few months!
The most significant changes include:
- Intern has been rewritten in TypeScript. This primarily affects the development of Intern rather than its usage, but users will benefit from more accurate TypeScript typings.
- Intern can be used programmatically. Previous versions of Intern were only intended to be used with built-in runner scripts, and did not provide a programmatic API.
- Intern is no longer dependent on the presence of an AMD loader. In Node it uses the environmental loader, and in a browser context Intern loads as a self-contained application. This makes using Intern much simpler in most cases.
- Code coverage is now opt-in. Rather than an
excludeInstrumentationto filter out modules that shouldn't be covered, users must now specify which modules to cover using acoverageproperty. - Intern is now configured using a declarative JSON structure. Previous versions of Intern were configured using an executable module. Using JSON data makes the configuration easier to reason about, and provides a more consistent interface across the command line, browser, and programmatic API.
- There is only one Node runner script. Intern 3 had two scripts,
intern-clientandintern-runner, for running unit tests and functional tests in Node. Intern 4 has a single runner script,intern, for running all test types. - Intern has a plugin API for extensions. Plugins may register listeners for test events or resources for use in tests, or simply make changes to Intern's configuration or the testing environment.
Other changes include:
- The object interface API accepts a new, less ambiguous object format.
- Errors are caught and reported in more places, so there should be fewer silent failures.
- Intern is now able to trace code references through multiple layers of source map.
- The runner script now returns a non-zero error code when a test run fails.
- The test interfaces explicitly past test and suite objects into callbacks (instead of relying on
this) to support arrow functions. - Intern no longer bundles custom types; it now fully relies on external types from DefinitelyTyped.
- The QUnit interface has been extracted to an external package.
- Intern's test server has been re-implemented using express, which will eventually allow for pluggable custom middleware.
- Some long-standing issues with test and suite counts in the TeamCity and Pretty reporters have been resolved.
- WebDriver tunnels are no longer forced to use the same proxy config that Intern uses to talk to WebDriver servers themselves.
For more information, check out the docs!