1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | 'use strict'
|
10 |
|
11 | module.exports = function (grunt) {
|
12 |
|
13 | grunt.initConfig({
|
14 | jshint: {
|
15 | all: [
|
16 | 'Gruntfile.js',
|
17 | 'lib/*.js',
|
18 | 'test/*.js'
|
19 | ],
|
20 | options: {
|
21 | jshintrc: '.jshintrc'
|
22 | }
|
23 | },
|
24 | mochaTest: {
|
25 | test: {
|
26 | options: {
|
27 | reporter: 'spec'
|
28 | },
|
29 | src: ['test/test.js']
|
30 | },
|
31 | testDefaultOptions: {
|
32 | options: {
|
33 | reporter: 'spec'
|
34 | },
|
35 | src: ['test/testDefaultOptions.js']
|
36 | },
|
37 | testDefaultOptionsAndBasePath: {
|
38 | options: {
|
39 | reporter: 'spec'
|
40 | },
|
41 | src: ['test/testDefaultOptionsBasePath.js']
|
42 | },
|
43 | testBasePath: {
|
44 | options: {
|
45 | reporter: 'spec'
|
46 | },
|
47 | src: ['test/testBasePath.js']
|
48 | }
|
49 |
|
50 | },
|
51 | clean: {
|
52 | test: ['test/local/**']
|
53 | },
|
54 | copy: {
|
55 | main: {
|
56 | files: [
|
57 | { expand: true, cwd: 'test/fixtures/', src: ['**'], dest: 'test/local' }
|
58 | ]
|
59 | }
|
60 | }
|
61 | })
|
62 |
|
63 | grunt.loadNpmTasks('grunt-contrib-jshint')
|
64 | grunt.loadNpmTasks('grunt-mocha-test')
|
65 | grunt.loadNpmTasks('grunt-contrib-clean')
|
66 | grunt.loadNpmTasks('grunt-contrib-copy')
|
67 |
|
68 |
|
69 | grunt.registerTask('lint', 'jshint')
|
70 | grunt.registerTask('default', ['clean', 'copy', 'mochaTest:test', 'clean', 'copy', 'mochaTest:testDefaultOptions', 'clean', 'copy', 'mochaTest:testBasePath', 'clean', 'copy', 'mochaTest:testDefaultOptionsAndBasePath'])
|
71 | }
|