UNPKG

1.38 kBJavaScriptView Raw
1/*global grunt */
2module.exports = function(grunt) {
3 grunt.initConfig({
4 jshint: {
5 options: {
6 jshintrc: '.jshintrc',
7 force: true
8 },
9 files: [
10 'lib/**/*.js',
11 'test/*.js',
12 'test/plugins/*.js'
13 ]
14 },
15
16 mochacov: {
17 test: {
18 options: {
19 reporter: 'spec'
20 },
21 src: ['test/*.js', 'test/plugins/*.js', 'test/util/*.js']
22 },
23 cov: {
24 options: {
25 reporter: 'html-cov'
26 },
27 src: ['test/*.js', 'test/plugins/*.js', 'test/util/*.js']
28 },
29 options: {
30 require: ['./test/lib/mocha-sinon']
31 }
32 },
33
34 githubPages: {
35 target: {
36 options: {
37 // The default commit message for the gh-pages branch
38 commitMessage: 'push'
39 },
40 // The folder where your gh-pages repo is
41 src: '_site'
42 }
43 }
44 });
45
46 grunt.loadNpmTasks('grunt-contrib-jshint');
47 grunt.loadNpmTasks('grunt-mocha-cov');
48 grunt.loadNpmTasks('grunt-github-pages');
49
50 grunt.registerTask('test', ['jshint', 'mochacov:test']);
51 grunt.registerTask('cov', ['mochacov:cov']);
52
53 grunt.registerTask('docs', function() {
54 this.async();
55
56
57 var Static = require('static'),
58 static = new Static('docs');
59 static.publish('_site');
60 });
61 grunt.registerTask('docs-deploy', ['githubPages:target']);
62};