Sauce Labs was affected by Heartbleed. Intern 1.6.2 now uses Sauce Connect 4.1 and provides additional bugfixes.

Intern takes the stress out of testing your Web app.

Run tests using the browser or node.js and seamlessly integrate with SauceLabs or Selenium. Write tests using object, TDD, or BDD styles and get full code coverage reporting with Istanbul. Continuous integration? Intern has you covered with Travis CI support out-of-the-box.

Get it on GitHub

Features

AMD by default

Intern uses the Asynchronous Module Definition format, so testing AMD-based applications is a breeze. (Non-AMD code can be tested just fine, too.)

Promise-based async

A test loop built with Promises makes asynchronous tests trivial to write and easy to read, with no wasteful polling and no nasty callback chains.

Code coverage

If you don’t know what code runs when your tests do, how do you know what’s broken? Intern gives you full statement, branch, function, and line code coverage reporting plus lcov output.

Functional testing

Mimic real user interactions from outside the JavaScript sandbox—and even test non-JavaScript Web apps—using our jQuery-like API based on the WebDriver standard.

Easy CI

Intern was designed with maintainability and continuous integration in mind. It’s been tested with Travis CI, and getting your own continuous integration set up is super easy.

Extensibility

Intern comes with Chai but works with any assertion library that throws errors, and its reporters and testing interfaces are fully modular and easy to extend.

Grunt support

Grunt is so popular we just went ahead and baked a task right into Intern, so you can use it straight-up without any third-party dependencies.

Great examples

Intern works great with any library or toolkit, and our community-contributed examples can show you how.

Truly open-source

Intern is New BSD licensed and follows the Dojo Foundation 100-point promise for the ultimate in peace-of-mind.

Write simple tests and see output quickly

Write one of these:
BDD
TDD
Object
define([
  'intern!bdd',
  'intern/chai!expect',
  '../MyWidget'
], function (bdd, expect, MyWidget) {
  bdd.describe('demo widget', function () {
    var widget;

    bdd.before(function () {
      widget = new MyWidget();
    });

    bdd.after(function () {
      widget.destroy();
    });

    bdd.it('should have children', function () {
      expect(widget.children).to.not.be.empty;
    });
  });
});
define([
  'intern!tdd',
  'intern/chai!assert',
  '../MyWidget'
], function (tdd, assert, MyWidget) {
  tdd.suite('demo widget', function () {
    var widget;

    tdd.before(function () {
      widget = new MyWidget();
    });

    tdd.after(function () {
      widget.destroy();
    });

    tdd.test('creation', function () {
      assert(widget.children.length > 0, 'Widget should have children');
    });
  });
});
define([
  'intern!object',
  'intern/chai!assert',
  '../MyWidget'
], function (registerSuite, assert, MyWidget) {
  var widget;

  registerSuite({
    name: 'demo widget',

    setup: function () {
      widget = new MyWidget();
    },

    teardown: function () {
      widget.destroy();
    },

    creation: function () {
      assert(widget.children.length > 0, 'Widget should have children');
    }
  });
});
Run this:
$ intern-runner config=tests/intern
Get this:
Opening local tunnel using Sauce Connect
Creating tunnel with Sauce Labs
Testing tunnel ready
...
Initialised firefox 19.0 on LINUX
Initialised chrome 25.0.1364.97 on LINUX
Initialised chrome 24.0.1312.57 on XP
Initialised firefox 19.0 on MAC
Initialised safari 6.0.1 on MAC
...
========= Coverage summary =========
Statements   : 87.15% ( 536/615 )
Branches     : 66.47% ( 111/167 )
Functions    : 79.55% ( 175/220 )
Lines        : 87.15% ( 536/615 )
====================================
TOTAL: tested 5 platforms, 0/710 tests failed

Run tests in any environment

Browser client

Run unit tests straight from any browser—no Node.js server needed!—by navigating to the included standalone HTML page.

Node.js client

Writing server-side code? A standalone Node.js client is also included, so you can test that too.

Test auto-runner

A testing framework isn’t very useful if it’s difficult to test all platforms. Intern includes an automated test runner that works with Sauce Labs or your own Selenium Grid.

Start testing your code today

Get it on GitHub New BSD License

How to contribute

Intern is an open-source project hosted on GitHub, so contributing is easy! Just fork us on GitHub, write your patch in a new branch, then submit a pull request. If you’ve never contributed to a Dojo Foundation project before, you will also need to take a moment to fill out the Dojo Foundation CLA. Please be sure to follow our coding conventions.

Need some help?

Don’t stress if you get stuck and need a little assistance. Free, community-provided Intern support is always available. SitePen also offers commercial support for Intern if you need a little extra TLC.