2012-11-02 13:03:09 +08:00
|
|
|
/*
|
|
|
|
* grunt-contrib-jasmine
|
|
|
|
* http://gruntjs.com/
|
|
|
|
*
|
2013-08-13 01:16:29 +08:00
|
|
|
* Copyright (c) 2013 GruntJS Team
|
2012-11-02 13:03:09 +08:00
|
|
|
* Licensed under the MIT license.
|
|
|
|
*/
|
|
|
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
module.exports = function(grunt) {
|
2013-03-23 01:07:20 +08:00
|
|
|
|
2012-11-02 13:03:09 +08:00
|
|
|
grunt.initConfig({
|
2013-03-23 01:07:20 +08:00
|
|
|
|
|
|
|
connect: {
|
|
|
|
return500: {
|
|
|
|
options: {
|
|
|
|
port: 9000,
|
|
|
|
middleware: function(connect, options) {
|
|
|
|
return [function(req, res, next){
|
|
|
|
res.statusCode = 500;
|
|
|
|
res.end();
|
|
|
|
}];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
2012-11-02 13:03:09 +08:00
|
|
|
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-12-03 16:17:06 +08:00
|
|
|
jasmine: {
|
|
|
|
pivotal: {
|
2013-06-16 00:38:39 +08:00
|
|
|
src: 'test/fixtures/pivotal/src/**/*.js',
|
|
|
|
options: {
|
|
|
|
specs: 'test/fixtures/pivotal/spec/*Spec.js',
|
|
|
|
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
|
|
|
|
junit: {
|
|
|
|
path: 'junit'
|
|
|
|
}
|
2013-06-16 02:15:01 +08:00
|
|
|
}
|
2013-06-16 00:38:39 +08:00
|
|
|
},
|
|
|
|
phantom_polyfills: {
|
|
|
|
src: 'test/fixtures/phantom-polyfills/src/**/*.js',
|
|
|
|
options : {
|
|
|
|
specs : 'test/fixtures/phantom-polyfills/spec/**/*.js',
|
|
|
|
}
|
2012-11-02 13:03:09 +08:00
|
|
|
},
|
2013-03-01 22:58:22 +08:00
|
|
|
legacyVersion: {
|
|
|
|
src: 'test/fixtures/pivotal/src/**/*.js',
|
|
|
|
options: {
|
2013-06-16 00:38:39 +08:00
|
|
|
specs: 'test/fixtures/pivotal/spec/*Spec.js',
|
|
|
|
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
|
|
|
|
version: '1.2.0',
|
|
|
|
junit: {
|
|
|
|
path: 'junit'
|
|
|
|
}
|
2013-03-01 22:58:22 +08:00
|
|
|
}
|
|
|
|
},
|
2013-06-16 01:13:26 +08:00
|
|
|
deepOutfile: {
|
|
|
|
src: 'test/fixtures/pivotal/src/**/*.js',
|
|
|
|
options: {
|
2013-06-16 02:15:01 +08:00
|
|
|
specs: 'test/fixtures/pivotal/spec/*Spec.js',
|
|
|
|
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
|
2013-06-16 01:13:26 +08:00
|
|
|
outfile: 'tmp/spec.html'
|
|
|
|
}
|
|
|
|
},
|
2013-06-16 02:15:01 +08:00
|
|
|
externalVendor: {
|
|
|
|
src: 'test/fixtures/externalVendor/src/**/*.js',
|
|
|
|
options: {
|
|
|
|
specs: 'test/fixtures/externalVendor/spec/**/*.js',
|
|
|
|
vendor: 'http://code.jquery.com/jquery-1.10.1.min.js'
|
|
|
|
}
|
|
|
|
},
|
2013-06-16 03:08:34 +08:00
|
|
|
// @todo: automate fail case here
|
|
|
|
// syntaxError: {
|
|
|
|
// src: 'test/fixtures/syntaxError/src/**/*.js',
|
|
|
|
// options: {
|
|
|
|
// specs: 'test/fixtures/syntaxError/spec/**/*.js'
|
|
|
|
// }
|
|
|
|
// },
|
2012-12-03 16:17:06 +08:00
|
|
|
customTemplate: {
|
|
|
|
src: 'test/fixtures/pivotal/src/**/*.js',
|
|
|
|
options: {
|
2013-06-16 00:38:39 +08:00
|
|
|
specs: 'test/fixtures/pivotal/spec/*Spec.js',
|
|
|
|
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
|
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
|
|
|
}
|
|
|
|
}
|
2013-03-23 01:07:20 +08:00
|
|
|
},
|
|
|
|
selfTest: {
|
|
|
|
options: {
|
|
|
|
specs:["test/selfTest/*.js"],
|
|
|
|
"--web-security": "no"
|
|
|
|
}
|
2012-11-02 13:03:09 +08:00
|
|
|
}
|
|
|
|
},
|
2013-03-23 01:07:20 +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');
|
|
|
|
grunt.loadNpmTasks('grunt-contrib-internal');
|
2013-03-23 01:07:20 +08:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-connect');
|
2012-11-02 13:03:09 +08:00
|
|
|
|
2013-03-23 01:07:20 +08:00
|
|
|
grunt.registerTask('test', ['connect:return500', 'jasmine', 'nodeunit']);
|
|
|
|
grunt.registerTask('default', ['jshint', 'test', 'build-contrib']);
|
2012-11-02 13:03:09 +08:00
|
|
|
};
|