UNPKG

1.51 kBJavaScriptView Raw
1"use strict";
2
3module.exports = function(grunt) {
4 require('load-grunt-tasks')(grunt);
5 grunt.initConfig({
6 jshint: {
7 files: ["package.json", "Gruntfile.js", "lib/**/*.js", "tasks/**/*.js", "test/**/*.js"],
8 options: {
9 jshintrc: true
10 }
11 },
12 jsbeautifier: {
13 default: {
14 src: ["<%= jshint.files %>", "!test/fixtures/**", "package.json"]
15 }
16 },
17 copy: {
18 tmp: {
19 src: ["**"],
20 dest: "tmp",
21 cwd: "test/fixtures",
22 expand: true
23 }
24 },
25 clean: ["tmp", "dest"],
26 mochaTest: {
27 test: {
28 options: {
29 reporter: 'spec'
30 },
31 src: ['test/**/*_spec.js']
32 }
33 },
34 devUpdate: {
35 main: {
36 options: {
37 updateType: 'force',
38 reportUpdated: false,
39 packages: {
40 devDependencies: true,
41 dependencies: true
42 }
43 }
44 }
45 }
46 });
47
48 // Actually load this plugin"s task(s).
49 grunt.loadTasks("tasks");
50
51 // By default, beautify, lint and run all tests.
52 grunt.registerTask("test", ["jshint", "copy", "clean", "mochaTest"]);
53 grunt.registerTask("default", ["devUpdate", "test", "jsbeautifier:default"]);
54};