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: {
|
|
|
|
files: ['test/fixtures/pivotal/**/*.js'],
|
|
|
|
tasks: 'jasmine:pivotal:build'
|
|
|
|
},
|
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',
|
|
|
|
helpers: 'test/fixtures/pivotal/spec/*Helper.js'
|
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: {
|
|
|
|
template: 'test/fixtures/customTemplate/custom.tmpl'
|
2012-11-02 13:03:09 +08:00
|
|
|
}
|
|
|
|
},
|
2012-12-03 16:17:06 +08:00
|
|
|
requirejs: {
|
|
|
|
src: 'test/fixtures/requirejs/src/**/*.js',
|
|
|
|
options: {
|
|
|
|
specs: 'test/fixtures/requirejs/spec/*Spec.js',
|
|
|
|
helpers: 'test/fixtures/requirejs/spec/*Helper.js',
|
|
|
|
host: 'http://127.0.0.1:<%= connect.test.port %>/',
|
|
|
|
template: 'requirejs',
|
|
|
|
templateOptions: {
|
|
|
|
requireConfig : {
|
|
|
|
baseUrl: './test/fixtures/requirejs/src/'
|
|
|
|
}
|
2012-11-02 13:03:09 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2012-11-02 13:03:09 +08:00
|
|
|
nodeunit: {
|
|
|
|
tasks: ['test/*_test.js']
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
grunt.loadTasks('tasks');
|
|
|
|
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-nodeunit');
|
2012-11-02 13:03:09 +08:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-connect');
|
2012-11-02 13:03:09 +08:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-internal');
|
2012-11-25 07:38:28 +08:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-watch');
|
2012-11-02 13:03:09 +08:00
|
|
|
|
2012-11-02 13:03:09 +08:00
|
|
|
grunt.registerTask('watch-test', ['connect', 'watch']);
|
|
|
|
|
2012-12-03 16:17:06 +08:00
|
|
|
grunt.registerTask('test', ['jasmine:pivotal', 'jasmine:customTemplate', 'connect', 'jasmine:requirejs', 'nodeunit']);
|
2012-11-02 13:03:09 +08:00
|
|
|
grunt.registerTask('default', ['jshint', 'test', 'build-contrib']);
|
2012-11-02 13:03:09 +08:00
|
|
|
};
|