Skip to content

Instantly share code, notes, and snippets.

@mihaihuluta
Last active December 16, 2015 20:18
Show Gist options
  • Save mihaihuluta/5490991 to your computer and use it in GitHub Desktop.
Save mihaihuluta/5490991 to your computer and use it in GitHub Desktop.
Karma-Runner
// Karma configuration
// Generated on Tue Apr 30 2013 07:58:45 GMT+0300 (GTB Summer Time)
// base path, that will be used to resolve files and exclude
basePath = '../';
// list of files / patterns to load in the browser
files = [
/* ANGULAR_SCENARIO,
ANGULAR_SCENARIO_ADAPTER,*/
JASMINE,
JASMINE_ADAPTER,
REQUIRE,
REQUIRE_ADAPTER,
// !! Put all libs in RequireJS 'paths' config here (included: false).
// All these files are files that are needed for the tests to run,
// but Karma is being told explicitly to avoid loading them, as they
// will be loaded by RequireJS when the main module is loaded.
'lib/angular/angular.js',
'lib/angular/angular-mocks.js',
//{pattern: 'scripts/lib/**/*.js', included: false},
// all the sources, tests // !! all src and test modules (included: false)
{pattern: 'scripts/**/*.js', included: false},
{pattern: 'scripts/*.js', included: false},
{pattern: 'tests/spec/*.js', included: false},
{pattern: 'tests/spec/**/*.js', included: false},
// !! test main require module last
'tests/spec/main.js'
];
// list of files to exclude
exclude = [];
// test results reporter to use
// possible values: 'dots', 'progress', 'junit'
reporters: ['progress', 'junit'];
junitReporter: {
// will be resolved to basePath (in the same way as files/exclude patterns)
outputFile: 'test-results.xml'
};
// 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_DEBUG;
// 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 = ['Chrome'];
// 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;
require.config({
// !! Karma serves files from '/base'
// (in this case, it is the root of the project /your-project/app/js)
baseUrl: '../',
paths: {
jquery: 'lib/jquery/jquery-1.9.1',
twitter: 'lib/bootstrap/js/bootstrap',
domReady: 'lib/require/domReady',
angular: 'lib/angular/angular',
angularResource: 'lib/angular/angular-resource',
angularMocks: 'lib/angular/angular-mocks',
unitTest: 'tests/spec'
},
// example of using shim, to load non-AMD libraries
// (such as Backbone, jQuery)
shim: {
angular: {
exports: 'angular'},
angularResource: { deps: ['angular']},
angularMocks: { deps: ['angularResource']}
}
});
// Start karma once the dom is ready.
require([
'domReady',
// Each individual test file will have to be added to this list to ensure
// that it gets run. Again, this will have to be maintained manually.
'unitTest/controllers/dummyControllerSpec'
], function (domReady) {
domReady(function () {
window.__karma__.start();
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment