Configuring Intern - msssk/intern GitHub Wiki

Intern configuration occurs through a single AMD module. If in a node.js environment, the module identifier of this file is specified using the config command-line argument; if in a browser environment, this is specified using the config url parameter. For an example of a working Intern configuration, you may look at the included example configuration file.

Configuration Options

Name
Default
Description
capabilities
{ 'idle-timeout': 60 }
The default desired capabilities for all environments being tested. These capabilities can be overridden per-environment in the environments array. See Selenium DesiredCapabilities for standard Selenium capabilities and Sauce Labs Additional Configuration for Sauce Labs capabilities. The name capability will be filled in with the module ID of the configuration file being used. The build capability will be filled in with the current commit ID from the TRAVIS_COMMIT environment variable automatically, if it exists.
environments
(empty array)
Environments (browsers) to run integration testing against. The same options used in capabilities are used for each environment specified in the array. If arrays are provided for browserName, version, platform, or platformVersion, all possible options will be permutated. For example:
environments: [ {
  browserName: 'chrome',
  version: [ '23', '24' ],
  platform: [ 'Linux', 'Mac OS 10.8' ]
} ]

This will generate 4 environments: Chrome 23 on Linux, Chrome 23 on Mac OS 10.8, Chrome 24 on Linux, and Chrome 24 on Mac OS 10.8. Other capabilities options specified for an environment are not permutated, but are simply used as-is.

Note that version numbers must be strings if using Sauce Labs.

excludeInstrumentation
(none)
A regular expression that matches the path-part of URLs (starting from the end of proxyUrl, excluding any trailing slash) that should not be instrumented during testing. Use this to exclude dependencies from being reported in your code coverage results. (Intern code—that is, anything that loads from {{proxyUrl}}/__intern/—is always excluded from code coverage results.)

As an example, excludeInstrumentation: /^(?:dojo|jquery|sencha)\// would prevent any code in the dojo, jquery, and sencha packages from being included in code coverage analysis.
functionalSuites
(empty array)
An array of module IDs corresponding to individual functional test suites that you want to execute when running Intern. Functional tests are different from unit tests because they are executed on the server, not the client, so are only available when using runner.js.
loader
Default baseUrl on Node.js is process.cwd()
Default baseUrl in browser is internDir + '../../'

{ baseUrl: baseUrl,
  packages: [
    { name: 'intern',
      location: internDir }
  ],
  map: { intern: {
    dojo: 'intern/node_modules/dojo',
    chai: 'intern/node_modules/chai/chai'
  }, '*': {
    'intern/dojo': 'intern/node_modules/dojo'
  } }
}
Configuration options for the AMD module loader. Any AMD configuration options supported by the Dojo loader can be used here. If you are testing an AMD application and need to use stub modules for testing, the map configuration option is the correct way to do this.
maxConcurrency
3
The maximum number of environments that should be tested simultaneously. Set this to Infinity to test in all environments at once. You may want to reduce this if you have a limited number of test machines available, or are using a shared Sauce Labs account.
proxyPort
9000
The port on which the instrumenting proxy will listen for requests.
proxyUrl
http://localhost:9000/
The URL to the proxy. You may decide to change this if you need to run the instrumenting proxy through another reverse proxy, or if your instrumenting proxy needs to be exposed on a public interface that your Selenium servers can access directly.
reporters
'runner' or 'console'
An array of reporter names (for reporters in intern/lib/reporters) or complete module IDs (for custom reporters) corresponding to reporters that should be used to report test results.
suites
(empty array)
An array of module IDs corresponding to individual unit test suites that you want to execute when running Intern. This option can be overridden in most cases by specifying one or more suites options on the command-line.
useLoader
{
  'host-node': 'dojo/dojo',
  'host-browser': 'node_modules/dojo/dojo.js'
}
New in Intern 1.3. If you want to use an alternative AMD loader like RequireJS when running unit tests, provide the path to the alternative loader here, relative to the Intern directory. The host-node loader should be a Node.js module ID, and the host-browser loader should be a URL to a script file. The loader must support the baseUrl, map, and packages configuration options.

For example, to use RequireJS installed in your parent project:
useLoader: {
  'host-node': 'requirejs',
  'host-browser': '../../node_modules/requirejs/require.js'
}
useSauceConnect
true
Whether or not to start Sauce Connect before running tests. This is necessary if you are using Travis CI. For quicker Intern runtimes, you may start Sauce Connect manually instead and set this to false.
webdriver
{ host: 'localhost',
  port: 4444 }
Connection information for the remote WebDriver (a.k.a. Selenium 2) service. Available options are host, port, username, and accessKey.

For Sauce Labs without Sauce Connect, the host should be ondemand.saucelabs.com.
For Sauce Connect, the host should be localhost. (Note that by default, Sauce Connect starts on port 4445 if it is not started by Intern with useSauceConnect.)
For custom Selenium 2 or Selenium 2 Grid servers, the host should be the address of your server.

username and accessKey are used by Sauce Labs only. If you do not want to expose your username and access key, put them in the SAUCE_USERNAME and SAUCE_ACCESS_KEY environment variables instead.
⚠️ **GitHub.com Fallback** ⚠️