2015-10-26 16:30:00 +00:00
|
|
|
module.exports = function (grunt) {
|
|
|
|
|
2015-12-10 02:44:18 +00:00
|
|
|
'use strict';
|
|
|
|
|
2015-10-26 16:30:00 +00:00
|
|
|
var opts = {
|
|
|
|
|
|
|
|
pkg: grunt.file.readJSON('package.json'),
|
|
|
|
|
|
|
|
simplemocha: {
|
|
|
|
options: {
|
|
|
|
globals: ['expect', 'should'],
|
|
|
|
timeout: 3000,
|
|
|
|
ignoreLeaks: false,
|
|
|
|
ui: 'bdd',
|
|
|
|
reporter: 'spec'
|
|
|
|
},
|
2015-12-28 09:01:30 +00:00
|
|
|
all: { src: ['test/*.js'] }
|
2015-11-21 08:10:11 +00:00
|
|
|
},
|
|
|
|
|
2016-01-18 02:46:58 +00:00
|
|
|
jsdoc : {
|
|
|
|
dist : {
|
|
|
|
src: ['src/**/*.js'],
|
|
|
|
options: {
|
|
|
|
private: true,
|
|
|
|
destination: 'doc'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2015-12-28 09:01:30 +00:00
|
|
|
clean: ['test/sandbox'],
|
2015-12-18 20:33:18 +00:00
|
|
|
|
2015-11-21 08:10:11 +00:00
|
|
|
yuidoc: {
|
|
|
|
compile: {
|
|
|
|
name: '<%= pkg.name %>',
|
|
|
|
description: '<%= pkg.description %>',
|
|
|
|
version: '<%= pkg.version %>',
|
|
|
|
url: '<%= pkg.homepage %>',
|
|
|
|
options: {
|
|
|
|
paths: 'src/',
|
|
|
|
//themedir: 'path/to/custom/theme/',
|
|
|
|
outdir: 'docs/'
|
|
|
|
}
|
|
|
|
}
|
2015-12-10 02:44:18 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
jshint: {
|
|
|
|
options: {
|
|
|
|
laxcomma: true,
|
|
|
|
expr: true
|
|
|
|
},
|
2015-12-29 08:50:00 +00:00
|
|
|
all: ['Gruntfile.js', 'src/**/*.js', 'test/*.js']
|
2015-10-26 16:30:00 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
grunt.initConfig( opts );
|
2015-12-10 02:44:18 +00:00
|
|
|
|
2015-10-26 16:30:00 +00:00
|
|
|
grunt.loadNpmTasks('grunt-simple-mocha');
|
2015-11-21 08:10:11 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-yuidoc');
|
2016-01-18 02:46:58 +00:00
|
|
|
grunt.loadNpmTasks('grunt-jsdoc');
|
2015-12-10 02:44:18 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-jshint');
|
2015-12-18 20:33:18 +00:00
|
|
|
grunt.loadNpmTasks('grunt-contrib-clean');
|
2015-12-10 02:44:18 +00:00
|
|
|
|
2015-12-19 17:37:42 +00:00
|
|
|
grunt.registerTask('test', 'Test the HackMyResume library.',
|
2016-01-18 02:46:58 +00:00
|
|
|
function( config ) { grunt.task.run(['clean','jshint','simplemocha:all']); });
|
2015-12-19 17:37:42 +00:00
|
|
|
grunt.registerTask('document', 'Generate HackMyResume library documentation.',
|
2016-01-18 02:46:58 +00:00
|
|
|
function( config ) { grunt.task.run( ['jsdoc'] ); });
|
|
|
|
grunt.registerTask('default', [ 'test', 'jsdoc' ]);
|
2015-10-26 16:30:00 +00:00
|
|
|
|
|
|
|
};
|