forked from theintern/intern
-
Notifications
You must be signed in to change notification settings - Fork 0
Using Custom Arguments and Configuration Properties
Jason Cheatham edited this page Jun 25, 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;
// Intern's current mode, either 'client' or 'runner'
intern.mode;
});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/