UNPKG

2.9 kBJavaScriptView Raw
1module.exports = function(grunt) {
2 'use strict';
3
4 require('load-grunt-tasks')(grunt);
5
6 // Project configuration.
7 grunt.initConfig({
8
9 clean: {
10 options: {
11 force : true
12 },
13 test: ['doc']
14 },
15
16 jsdoc: {
17 basic: {
18 src: ['tasks/**.js', 'tasks/lib/*.js'],
19 options: {
20 destination: 'doc/basic'
21 }
22 },
23 alternate: {
24 src: ['tasks'],
25 dest : 'doc/alternate',
26 options: {
27 readme : 'README.md',
28 recurse : true,
29 private : false
30 }
31 },
32 spacepack: {
33 src: ['tasks/**/*.js'],
34 options: {
35 destination: 'doc/pack age',
36 package: 'package.json'
37 }
38 },
39 docstrap: {
40 src: ['tasks/**.js', 'tasks/lib/*.js', 'README.md'],
41 options: {
42 destination: 'doc/docstrap',
43 template: 'node_modules/ink-docstrap/template',
44 configure: 'node_modules/ink-docstrap/template/jsdoc.conf.json'
45 }
46 },
47 nosrc : {
48 options: {
49 configure : 'test/nosrc.json'
50 }
51 }
52 },
53 nodeunit: {
54 unit: ['test/jsdoc-plugin_test.js'],
55 basic: ['test/jsdoc-basic_test.js'],
56 alternate: ['test/jsdoc-alternate_test.js'],
57 docstrap: ['test/jsdoc-docstrap_test.js'],
58 spacepack: ['test/jsdoc-spacepack_test.js'],
59 nosrc: ['test/jsdoc-nosrc_test.js']
60 },
61
62 eslint: {
63 all: {
64 src: ['Gruntfile.js', 'tasks/**/*.js', 'test/**/*.js']
65 }
66 }
67 });
68
69 // Load local tasks.
70 grunt.loadTasks('tasks');
71
72
73 //testing tasks
74 grunt.registerTask('test-basic', 'Test basic jsdoc', ['jsdoc:basic', 'nodeunit:basic']);
75 grunt.registerTask('test-alternate', 'Test jsdoc with alternate options', ['jsdoc:alternate', 'nodeunit:alternate']);
76 grunt.registerTask('test-docstrap', 'Test jsdoc with a template', ['jsdoc:docstrap', 'nodeunit:docstrap']);
77 grunt.registerTask('test-spacepack', 'Test jsdoc with a package and spaces in the paths', ['jsdoc:spacepack', 'nodeunit:spacepack']);
78 grunt.registerTask('test-nosrc', 'Test jsdoc without src and dest, only a config', ['jsdoc:nosrc', 'nodeunit:nosrc']);
79 grunt.registerTask('test', 'Full test suite', ['clean:test', 'nodeunit:unit', 'test-basic', 'test-alternate', 'test-docstrap', 'test-spacepack', 'test-nosrc']);
80
81 grunt.registerTask('default', 'Default task will lint and test', ['eslint:all', 'test']);
82};
83