grunt-contrib-jasmine/Gruntfile.js

147 lines
3.7 KiB
JavaScript
Raw Permalink Normal View History

2012-11-02 13:03:09 +08:00
/*
* grunt-contrib-jasmine
* http://gruntjs.com/
*
2016-01-05 09:14:52 +08:00
* Copyright (c) 2016 GruntJS Team
2012-11-02 13:03:09 +08:00
* Licensed under the MIT license.
*/
'use strict';
module.exports = function(grunt) {
2013-10-25 11:16:14 +08:00
2012-11-02 13:03:09 +08:00
grunt.initConfig({
connect: {
return500: {
options: {
2015-01-09 05:16:44 +08:00
port: 10921,
2015-10-23 08:04:31 +08:00
middleware: function() {
return [function(req, res) {
res.statusCode = 500;
res.end();
}];
}
}
2015-10-23 08:04:31 +08:00
}
},
2012-11-02 13:03:09 +08:00
jshint: {
all: [
'Gruntfile.js',
2015-04-24 06:36:23 +08:00
'tasks/**/*.js',
'test/*.js',
'test/selfTest/*.js'
2012-11-02 13:03:09 +08:00
],
options: {
jshintrc: '.jshintrc'
}
},
2015-10-23 08:04:31 +08:00
watch: {
dev: {
files: ['tasks/**/*'],
tasks: ['jasmine:pivotal:build']
}
},
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',
summary: true,
2013-06-16 00:38:39 +08:00
junit: {
path: 'junit'
}
}
2013-06-16 00:38:39 +08:00
},
2015-10-23 08:04:31 +08:00
phantomPolyfills: {
2013-06-16 00:38:39 +08:00
src: 'test/fixtures/phantom-polyfills/src/**/*.js',
2015-10-23 08:04:31 +08:00
options: {
specs: 'test/fixtures/phantom-polyfills/spec/**/*.js'
2013-06-16 00:38:39 +08:00
}
},
consoleDisplayOptions: {
src: 'test/fixtures/pivotal/src/**/*.js',
options: {
specs: 'test/fixtures/pivotal/spec/*Spec.js',
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
display: 'short',
2015-10-23 08:04:31 +08:00
summary: true
}
},
2014-06-08 06:07:02 +08:00
consoleDisplayOptionsNone: {
src: 'test/fixtures/pivotal/src/**/*.js',
options: {
specs: 'test/fixtures/pivotal/spec/*Spec.js',
helpers: 'test/fixtures/pivotal/spec/*Helper.js',
display: 'none',
2015-10-23 08:04:31 +08:00
summary: true
2014-06-08 06:07:02 +08:00
}
},
2013-06-16 01:13:26 +08:00
deepOutfile: {
src: 'test/fixtures/pivotal/src/**/*.js',
options: {
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'
}
},
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'
}
},
// @todo: automate fail case here
// syntaxError: {
// src: 'test/fixtures/syntaxError/src/**/*.js',
// options: {
// specs: 'test/fixtures/syntaxError/spec/**/*.js'
// }
// },
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',
template: 'test/fixtures/customTemplate/custom.tmpl',
junit: {
path: 'junit/customTemplate',
consolidate: true
}
}
},
customTempDir: {
src: 'test/fixtures/custom-temp-dir/src/**/*.js',
options: {
specs: 'test/fixtures/custom-temp-dir/spec/**/*.js',
tempDir: '.custom/'
}
},
selfTest: {
options: {
2015-10-23 08:04:31 +08:00
specs: ['test/selfTest/*.js'],
'--web-security': 'no'
}
}
},
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-watch');
2012-11-02 13:03:09 +08:00
grunt.loadNpmTasks('grunt-contrib-nodeunit');
grunt.loadNpmTasks('grunt-contrib-internal');
grunt.loadNpmTasks('grunt-contrib-connect');
2012-11-02 13:03:09 +08:00
grunt.registerTask('test', ['jshint', 'connect:return500', 'jasmine', 'nodeunit']);
grunt.registerTask('default', ['test', 'build-contrib']);
2012-11-02 13:03:09 +08:00
};