2012-11-02 13:03:09 +08:00
|
|
|
/*
|
|
|
|
* grunt-contrib-jasmine
|
|
|
|
* http://gruntjs.com/
|
|
|
|
*
|
|
|
|
* Copyright (c) 2012 GruntJS Team
|
|
|
|
* Licensed under the MIT license.
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
module.exports = function(grunt) {
|
|
|
|
grunt.initConfig({
|
|
|
|
jshint: {
|
|
|
|
all: [
|
|
|
|
'Gruntfile.js',
|
2012-11-02 13:03:09 +08:00
|
|
|
'tasks/**/*.js'
|
2012-11-02 13:03:09 +08:00
|
|
|
],
|
|
|
|
options: {
|
|
|
|
jshintrc: '.jshintrc'
|
|
|
|
}
|
|
|
|
},
|
2012-11-02 13:03:09 +08:00
|
|
|
watch: {
|
2013-02-24 08:44:19 +08:00
|
|
|
pivotal: {
|
|
|
|
files: ['test/fixtures/pivotal/**/*.js'],
|
|
|
|
tasks: 'jasmine:pivotal:build'
|
|
|
|
},
|
|
|
|
jasmine: {
|
|
|
|
files: ['test/fixtures/pivotal/**/*.js', 'tasks/**/*.js'],
|
|
|
|
tasks: 'jasmine:pivotal'
|
|
|
|
}
|
2012-11-02 13:03:09 +08:00
|
|
|
},
|
2012-12-03 16:17:06 +08:00
|
|
|
connect: {
|
|
|
|
test: {
|
|
|
|
port: 8000,
|
|
|
|
base: '.'
|
2012-11-25 07:38:28 +08:00
|
|
|
}
|
2012-11-02 13:03:09 +08:00
|
|
|
},
|
2012-12-03 16:17:06 +08:00
|
|
|
jasmine: {
|
|
|
|
options: {
|
|
|
|
specs: 'test/fixtures/pivotal/spec/*Spec.js',
|
2013-01-09 03:28:26 +08:00
|
|
|
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
|
|
|
|
junit: {
|
|
|
|
path: 'junit'
|
|
|
|
}
|
2012-11-02 13:03:09 +08:00
|
|
|
},
|
2012-12-03 16:17:06 +08:00
|
|
|
pivotal: {
|
|
|
|
src: 'test/fixtures/pivotal/src/**/*.js'
|
2012-11-02 13:03:09 +08:00
|
|
|
},
|
2012-12-03 16:17:06 +08:00
|
|
|
customTemplate: {
|
|
|
|
src: 'test/fixtures/pivotal/src/**/*.js',
|
|
|
|
options: {
|
2013-01-09 03:28:26 +08:00
|
|
|
template: 'test/fixtures/customTemplate/custom.tmpl',
|
|
|
|
junit: {
|
|
|
|
path: 'junit/customTemplate',
|
|
|
|
consolidate: true
|
2012-11-02 13:03:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2012-11-02 13:03:09 +08:00
|
|
|
nodeunit: {
|
|
|
|
tasks: ['test/*_test.js']
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadTasks('tasks');
|
|
|
|
|
2013-02-24 08:43:29 +08:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
2012-11-02 13:03:09 +08:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-nodeunit');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-internal');
|
|
|
|
|
2013-02-24 08:44:19 +08:00
|
|
|
grunt.registerTask('watch-test', ['connect', 'watch:pivotal']);
|
2012-11-02 13:03:09 +08:00
|
|
|
|
2013-01-09 03:28:26 +08:00
|
|
|
grunt.registerTask('test', ['jshint', 'jasmine:pivotal', 'jasmine:customTemplate', 'nodeunit']);
|
|
|
|
grunt.registerTask('default', ['test', 'build-contrib']);
|
2012-11-02 13:03:09 +08:00
|
|
|
};
|