Skip to content

Commit

Permalink
Getting test framework set up
Browse files Browse the repository at this point in the history
  • Loading branch information
peterneely committed Oct 14, 2014
1 parent f243901 commit fe007e9
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ module.exports = function (grunt) {
// Test settings
karma: {
unit: {
configFile: 'test/karma.conf.js',
configFile: 'karma.conf.js',
singleRun: true
}
}
Expand Down
40 changes: 33 additions & 7 deletions karma.conf.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,16 @@ module.exports = function(config) {
// list of files / patterns to load in the browser
files: [
'src/bower_components/angular/angular.js',
'src/bower_components/angular/angular-mocks.js',
'src/app/scripts/*.js',
'src/app/scripts/**/*.js',
'test/mock/**/*.js',
'src/bower_components/angular-mocks/angular-mocks.js',
'src/bower_components/angular-animate/angular-animate.js',
'src/bower_components/angular-cookies/angular-cookies.js',
'src/bower_components/angular-resource/angular-resource.js',
'src/bower_components/angular-route/angular-route.js',
'src/bower_components/angular-sanitize/angular-sanitize.js',
'src/bower_components/angular-touch/angular-touch.js',
// 'src/app/*.js',
'src/app/**/*.js',
// 'test/mock/**/*.js',
'test/spec/**/*.js'
],

Expand All @@ -31,7 +37,7 @@ module.exports = function(config) {


// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
autoWatch: true,


// Start these browsers, currently available:
Expand All @@ -42,11 +48,31 @@ module.exports = function(config) {
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
browsers: ['Chrome'],
browsers: [
'PhantomJS'
],

// Which plugins to enable
plugins: [
'karma-phantomjs-launcher',
'karma-jasmine'
],

// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false
singleRun: false,

colors: true,

// level of logging
// possible values: LOG_DISABLE || LOG_ERROR || LOG_WARN || LOG_INFO || LOG_DEBUG
logLevel: config.LOG_INFO,

// Uncomment the following lines if you are using grunt's server to run the tests
// proxies: {
// '/': 'http://localhost:9000/'
// },
// URL root prevent conflicts with the site root
// urlRoot: '_karma_'
});
};
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,16 @@
"grunt-contrib-watch": "^0.6.1",
"grunt-filerev": "^0.2.1",
"grunt-google-cdn": "^0.4.0",
"grunt-karma": "^0.9.0",
"grunt-newer": "^0.7.0",
"grunt-ngmin": "^0.0.3",
"grunt-svgmin": "^0.4.0",
"grunt-usemin": "^2.1.1",
"grunt-wiredep": "^1.7.0",
"jshint-stylish": "^0.2.0",
"karma": "^0.12.23",
"karma-jasmine": "^0.1.5",
"karma-phantomjs-launcher": "^0.1.4",
"load-grunt-tasks": "^0.4.0",
"time-grunt": "^0.3.1"
},
Expand All @@ -33,4 +37,4 @@
"scripts": {
"test": "grunt test"
}
}
}

0 comments on commit fe007e9

Please sign in to comment.