Updated karma to 0.9

Tests are now cross-platform and runs in local phantomJS instead of in
chrome, remember to run npm install to upgrade
This commit is contained in:
Per Ploug
2013-06-26 15:46:36 +02:00
parent 7a89cf1ffd
commit d2273ee8ce
4 changed files with 120 additions and 17 deletions

View File

@@ -7,17 +7,19 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-copy');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-testacular');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('grunt-open');
grunt.loadNpmTasks('grunt-markdown');
grunt.loadNpmTasks('grunt-contrib-connect');
// Default task.
grunt.registerTask('default', ['jshint:dev','build','testacular:unit']);
grunt.registerTask('default', ['jshint:dev','build','karma:unit']);
grunt.registerTask('dev', ['jshint:dev', 'build', 'webserver', 'open:dev', 'watch']);
//run by the watch task
grunt.registerTask('watch-build', ['jshint:dev','recess:build','testacular:unit','concat','copy']);
grunt.registerTask('watch-build', ['jshint:dev','recess:build','karma:unit','concat','copy']);
//triggered from grunt dev or grunt
grunt.registerTask('build', ['clean','concat','recess:build','copy']);
@@ -31,12 +33,6 @@ module.exports = function (grunt) {
grunt.log.subhead(Date());
});
var testacularConfig = function(configFile, customOptions) {
var options = { configFile: configFile, keepalive: true };
var travisOptions = process.env.TRAVIS && { browsers: ['Firefox'], reporters: 'dots' };
return grunt.util._.extend(options, customOptions, travisOptions);
};
// Project configuration.
grunt.initConfig({
connect: {
@@ -116,10 +112,10 @@ module.exports = function (grunt) {
}
},
testacular: {
unit: { options: testacularConfig('test/config/unit.js') },
e2e: { options: testacularConfig('test/config/e2e.js') },
watch: { options: testacularConfig('test/config/unit.js', {singleRun:false, autoWatch: true}) }
karma: {
unit: { configFile: 'test/config/karma.conf.js', keepalive: true },
e2e: { configFile: 'test/config/e2e.js', keepalive: true },
watch: { configFile: 'test/config/unit.js', singleRun:false, autoWatch: true, keepalive: true }
},
concat:{