Today we’re happy to announce the release of Intern 2.1. This release contains several bugfixes and improvements to existing functionality, as well as new features to make running tests and handling test results easier. The full list of enhancements and bugfixes is available in the release notes. Here are some of the highlights!
More output options
Two new reporters have been added to Intern: an HTML reporter for the browser client and a JUnit XML reporter.
The HTML reporter is a new default reporter for Intern’s browser client runner (
client.html). It displays at the end of a test run, summarizing the test results and presenting them in an easy-to-read format:
The output of the JUnit reporter, on the other hand, is meant for machine consumption. It aggregates test results and outputs them in a
report.xml file that follows generally accepted standards for JUnit-compatible XML. This makes it much easier to plug Intern into tools that accept JUnit reports, like Jenkins.
Choosing which tests to run
We’ve added two new command line arguments,
grep, and new test skipping functionality.
functionalSuites argument works just like the existing
suites argument and overrides whatever is set in the
functionalSuites configuration property:
intern-runner config=tests/intern \ functionalSuites=tests/functional/myWidget \ functionalSuites=tests/functional/myOtherWidget
grep argument, available both on the command-line and as a configuration file property, lets the user filter test IDs (e.g., “main – mySuite – click the done button”) using a regular expression.
For example, to run only the tests whose IDs contain the phrase “done button”:
intern-runner config=tests/intern grep="done button"
When a test is filtered by grep, Intern skips it and reports it as skipped.
Test writers can also programmatically skip tests using the new
skip function. A test can call
this.skip(<message>) at any time to halt execution and move to the next test. The skip message will be reported by all built-in reporters, as well as any custom reporters that listen for the new
As always, this release contains many other smaller improvements to Intern’s existing functionality:
- The Istanbul and Leadfoot dependencies have been updated to incorporate new features and bug fixes
- Intern’s code instrumentation handles Windows file paths correctly
- Suites now provide elapsed time on an
- Intern now works when started using a subdirectory proxy
- Proxy performance has been improved
- Intern no longer starts the unit test execution process if the
suitesproperty is empty
For more information on Intern’s features, usage examples, and documentation, please visit the Intern Web site. If you’re not sure where to start with Intern, or you need some help making your code more testable, SitePen can help! Contact us for a free 30-minute consultation.