Skip to content

Instantly share code, notes, and snippets.

@wrumsby
Created June 13, 2013 09:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wrumsby/5772341 to your computer and use it in GitHub Desktop.
Save wrumsby/5772341 to your computer and use it in GitHub Desktop.
Karma setup
// 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;
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
});
@wrumsby
Copy link
Author

wrumsby commented Jun 13, 2013

This config is based on the Karma + RequireJS documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment