forked from karma-runner/karma
-
Notifications
You must be signed in to change notification settings - Fork 0
Configuration File Overview
matsko edited this page Jan 16, 2013
·
9 revisions
To configure Testacular you use a configuration file and supply this file when starting Testacular. Here is a list of all possible configuration values that can be used, including their default values.
- Type. String
-
Default.
''
- Description. Base path, that will be used to resolve files and exclude.
- Type. Array
-
Default.
[]
- Description. List of files/patterns to load in the browser. See Files for more information.
- Type. Array
-
Default.
[]
- Description. List of files to exclude.
- Type. Array
-
Default.
['progress']
-
Possible Values.
dots
progress
junit
- Description. A list of reporters to use. See Reporters for more.
- Type. Number
-
Default.
8080
- Description. Web server port
- Type. Number
-
Default.
9100
- Description. Cli runner port
- Type. Boolean
-
Default.
true
- Description. Enable / disable colors in the output (reporters and logs).
- Type. Constant
-
Default.
LOG_INFO
-
Possible values.
LOG_DISABLE
LOG_ERROR
LOG_WARN
LOG_INFO
LOG_DEBUG
- Description. Level of logging.
- Type. Boolean
-
Default.
false
- Description. Enable/disable watching file and executing tests whenever any file changes.
- Type. Array
-
Default.
[]
-
Possible Values.
Chrome
ChromeCanary
Firefox
Opera
Safari
PhantomJS
- Description. A list of browsers to test in. See Browsers for more.
- Type. Boolean
-
Default.
false
-
Description. Continuous Integration mode if
true
, it captures browsers, runs tests and exits.
- Type. Object
-
Default.
{}
- Description. List modules to preprocess your files before they get served to the browser. See Preprocessors for more.
- Type. Object
-
Default.
{}
-
Description. List path-proxy pairs. For example:
proxies: {'/static': 'http://gstatic.com', '/web': 'http://localhost:9000'}
.
If you wish to use configuration directives from another testacular configuration file (like a shared configuration file) then this can be done by a simple require
call directly inside the configuration file.
So lets say you have a file called shared.conf.js
which is located in the same directory as your testacular.conf.js
then this can be included like so:
First the shared.conf.js file:
//shared.conf.js
var defaultBrowsers = ['Chrome'];
And then the primary configuration file:
//testacular.conf.js
var shared = require(__dirname + '/shared.conf.js');
//now any variables defined inside of the shared.conf.js file
//are accessible via the shared variable.
browsers = shared.defaultBrowsers;
browsers.push('PhantomJS');
The __dirname
variable instructs testacular to load the file from where the testacular
command was executed.