Created
June 13, 2013 09:13
-
-
Save wrumsby/5772341 to your computer and use it in GitHub Desktop.
Karma setup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Karma configuration | |
// Generated on Thu Jun 13 2013 20:35:00 GMT+1200 (NZST) | |
// base path, that will be used to resolve files and exclude | |
basePath = ''; | |
// list of files / patterns to load in the browser | |
files = [ | |
MOCHA, | |
MOCHA_ADAPTER, | |
REQUIRE, | |
REQUIRE_ADAPTER, | |
{pattern: 'jam/**/*.js', included: false}, | |
{pattern: 'src/**/*.js', included: false}, | |
{pattern: 'test/**/*.js', included: false}, | |
'test-main.js' | |
]; | |
// list of files to exclude | |
exclude = [ | |
'jam/mocha/**/*.js' | |
]; | |
// test results reporter to use | |
// possible values: 'dots', 'progress', 'junit' | |
reporters = ['progress']; | |
// web server port | |
port = 9876; | |
// cli runner port | |
runnerPort = 9100; | |
// enable / disable colors in the output (reporters and logs) | |
colors = true; | |
// level of logging | |
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG | |
logLevel = LOG_INFO; | |
// enable / disable watching file and executing tests whenever any file changes | |
autoWatch = false; | |
// Start these browsers, currently available: | |
// - Chrome | |
// - ChromeCanary | |
// - Firefox | |
// - Opera | |
// - Safari (only Mac) | |
// - PhantomJS | |
// - IE (only Windows) | |
browsers = []; | |
// If browser does not capture in given timeout [ms], kill it | |
captureTimeout = 60000; | |
// Continuous Integration mode | |
// if true, it capture browsers, run tests and exit | |
singleRun = false; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mocha.setup('bdd'); | |
mocha.setup({ | |
'globals': ['XMLHttpRequest', 'setTimeout', 'setInterval', 'clearTimeout', 'clearInterval'] | |
}); | |
requirejs.config({ | |
packages: [ | |
{ | |
name: 'chai', | |
location: 'jam/chai', | |
main: 'chai/chai.js' | |
}, | |
{ | |
name: 'reqwest', | |
location: 'jam/reqwest', | |
main: './reqwest.js' | |
}, | |
{ | |
name: 'ristretto', | |
location: 'jam/ristretto', | |
main: 'ristretto.js' | |
}, | |
{ | |
name: 'sinon', | |
location: 'jam/sinon', | |
main: 'sinon.js' | |
} | |
], | |
shim: { | |
sinon: { | |
exports: 'sinon' | |
} | |
}, | |
paths: { | |
'boilerplate': 'base/src', | |
'test': 'base/test', | |
'ristretto': 'base/jam/ristretto/ristretto', | |
'sinon': 'base/jam/sinon/sinon', | |
'reqwest': 'base/jam/reqwest/reqwest' | |
}, | |
deps: ['test/simple'], | |
// start test run, once Require.js is done | |
callback: window.__karma__.start | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This config is based on the Karma + RequireJS documentation.