UNPKG

1.41 kBJavaScriptView Raw
1module.exports = function (grunt) {
2
3 'use strict';
4
5 var opts = {
6
7 pkg: grunt.file.readJSON('package.json'),
8
9 simplemocha: {
10 options: {
11 globals: ['expect', 'should'],
12 timeout: 3000,
13 ignoreLeaks: false,
14 ui: 'bdd',
15 reporter: 'spec'
16 },
17 all: { src: ['tests/*.js'] }
18 },
19
20 clean: ['tests/sandbox'],
21
22 yuidoc: {
23 compile: {
24 name: '<%= pkg.name %>',
25 description: '<%= pkg.description %>',
26 version: '<%= pkg.version %>',
27 url: '<%= pkg.homepage %>',
28 options: {
29 paths: 'src/',
30 //themedir: 'path/to/custom/theme/',
31 outdir: 'docs/'
32 }
33 }
34 },
35
36 jshint: {
37 options: {
38 laxcomma: true,
39 expr: true
40 },
41 all: ['Gruntfile.js', 'src/**/*.js', 'test/**/*.js']
42 }
43
44 };
45
46 grunt.initConfig( opts );
47
48 grunt.loadNpmTasks('grunt-simple-mocha');
49 grunt.loadNpmTasks('grunt-contrib-yuidoc');
50 grunt.loadNpmTasks('grunt-contrib-jshint');
51 grunt.loadNpmTasks('grunt-contrib-clean');
52
53 grunt.registerTask('test', 'Test the HackMyResume library.',
54 function( config ) { grunt.task.run( ['clean','simplemocha:all'] ); });
55 grunt.registerTask('document', 'Generate HackMyResume library documentation.',
56 function( config ) { grunt.task.run( ['yuidoc'] ); });
57 grunt.registerTask('default', [ 'jshint', 'test', 'yuidoc' ]);
58
59};