Skip to content

Using Custom Arguments and Configuration Properties

Colin Snover edited this page Apr 13, 2014 · 4 revisions

As of Intern 1.6, it is possible to retrieve the current Intern configuration being used to run tests, as well as retrieve custom arguments. This information is available from the main intern object:

require([ 'intern' ], function (intern) {
  // arguments object
  intern.args;

  // config object
  intern.config;
});

This makes it possible to, for example, define a dynamic proxy URL from the command-line or Grunt task:

// in tests/config.js
define([ 'intern' ], function (intern) {
  return {
    proxyUrl: intern.args.proxyUrl,

    // ... additional configuration ...
  };
});
$ intern-runner config=tests/config proxyUrl=http://www.example.com:1234/

Clone this wiki locally