get grunt-karma working with build flow

This commit is contained in:
Adam Shaw
2014-05-30 23:51:16 -07:00
parent 24a40d9340
commit ddb9dfb2f7
3 changed files with 28 additions and 17 deletions
+26 -2
View File
@@ -12,6 +12,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-jscs-checker');
grunt.loadNpmTasks('grunt-karma');
grunt.loadNpmTasks('lumbar');
// Parse config files
@@ -42,6 +43,14 @@ module.exports = function(grunt) {
'languages'
]);
// Builds a clean dist directory, for a new release possibly
grunt.registerTask('dist', [
'clean',
'modules',
'languages',
'karma:continuous'
]);
/* FullCalendar Modules
@@ -133,6 +142,20 @@ module.exports = function(grunt) {
/* Automated Tests
----------------------------------------------------------------------------------------------------*/
config.karma = {
options: {
configFile: 'karma.conf.js'
},
url: {}, // you'll have to visit a URL in a browser
headless: { browsers: [ 'PhantomJS' ] },
continuous: { browsers: [ 'PhantomJS' ], singleRun: true } // "continuous integration" mode
};
/* Archive
----------------------------------------------------------------------------------------------------*/
@@ -140,6 +163,7 @@ module.exports = function(grunt) {
'clean:archive',
'modules',
'languages',
'karma:continuous',
'copy:archiveModules',
'copy:archiveLanguages',
'copy:archiveLanguagesAll',
@@ -259,6 +283,7 @@ module.exports = function(grunt) {
'clean:cdnjs',
'modules',
'languages',
'karma:continuous',
'copy:cdnjsModules',
'copy:cdnjsLanguages',
'copy:cdnjsLanguagesAll',
@@ -296,8 +321,7 @@ module.exports = function(grunt) {
);
});
config.clean.cdnjs = 'dist/cdnjs/<%= meta.version %>';
// NOTE: not a complete clean. also need to manually worry about package.json and version folders
config.clean.cdnjs = 'dist/cdnjs';
+1 -15
View File
@@ -56,21 +56,7 @@ module.exports = function(config) {
// enable / disable watching file and executing tests whenever any file changes
autoWatch: true,
// Start these browsers, currently available:
// - Chrome
// - ChromeCanary
// - Firefox
// - Opera
// - Safari (only Mac)
// - PhantomJS
// - IE (only Windows)
//browsers: [ 'PhantomJS' ],
// 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
captureTimeout: 60000
});
};
+1
View File
@@ -15,6 +15,7 @@
"grunt-contrib-clean": "~0.4.0",
"grunt-contrib-jshint": "~0.8.0",
"grunt-jscs-checker": "~0.3.2",
"grunt-karma": "^0.8.3",
"lumbar": "~2.0.0-beta19",
"karma": "^0.12.1",
"karma-jasmine": "^0.2.2",