UNPKG

1.65 kBJavaScriptView Raw
1/* global module */
2module.exports = function (grunt) {
3 module.require('time-grunt')(grunt);
4
5 grunt.initConfig({
6 pkg: grunt.file.readJSON('package.json'),
7
8 'nice-package': {
9 all: {
10 options: {
11 blankLine: true
12 }
13 }
14 },
15
16 jshint: {
17 'options': {
18 jshintrc: '.jshintrc'
19 },
20 default: {
21 'src': [ '*.js', 'test/*.js' ]
22 }
23 },
24
25 sync: {
26 all: {
27 options: {
28 sync: ['author', 'name', 'version',
29 'private', 'license', 'keywords', 'homepage'],
30 }
31 }
32 },
33
34 mochaTest: {
35 test: {
36 options: {
37 reporter: 'spec'
38 },
39 src: ['test/*.spec.js']
40 }
41 },
42
43 'clean-console': {
44 all: {
45 options: {
46 url: ['index.html'],
47 timeout: 1
48 }
49 }
50 },
51
52 karma: {
53 unit: {
54 configFile: 'karma.conf.js',
55 background: false,
56 singleRun: true,
57 logLevel: 'INFO',
58 browsers: ['PhantomJS']
59 }
60 },
61
62 watch: {
63 options: {
64 atBegin: true
65 },
66 all: {
67 files: ['*.js', 'test/*.js', 'index.html'],
68 tasks: ['jshint', 'test']
69 }
70 },
71
72 'gh-pages': {
73 options: {
74 base: '.'
75 },
76 src: [
77 'README.md',
78 'index.js',
79 'index.html'
80 ]
81 }
82 });
83
84 var plugins = module.require('matchdep').filterDev('grunt-*');
85 plugins.forEach(grunt.loadNpmTasks);
86
87 grunt.registerTask('test', ['mochaTest', 'karma', 'clean-console']);
88 grunt.registerTask('default', ['deps-ok', 'nice-package', 'sync', 'jshint', 'test']);
89};