This repository has been archived by the owner on Jun 9, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Gruntfile.js
67 lines (64 loc) · 2.08 KB
/
Gruntfile.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*jshint node:true*/
"use strict";
module.exports = function( grunt ) {
grunt.initConfig( {
pkg: grunt.file.readJSON( 'package.json' ),
connect: {
server: {
options: {
port: 8080
}
}
},
jsbeautifier: {
test: {
src: [ "*.js", "src/js/*.js" ],
options: {
config: "./.jsbeautifyrc",
mode: "VERIFY_ONLY"
}
},
fix: {
src: [ "*.js", "src/js/*.js" ],
options: {
config: "./.jsbeautifyrc"
}
}
},
jshint: {
options: {
jshintrc: '.jshintrc'
},
all: [ '*.js', 'src/js/**/*.js' ]
},
jasmine: {
test: {
src: 'src/FormModelJSON.js ',
options: {
keepRunner: true,
specs: 'test/spec/*.js',
helpers: [ 'test/mock/*.js' ],
template: require( 'grunt-template-jasmine-requirejs' ),
templateOptions: {
requireConfig: {
baseUrl: 'src',
paths: {
jquery: '../lib/jquery',
'jquery.xpath': '../lib/jquery-xpath/jquery.xpath'
}
}
}
},
}
}
} );
grunt.loadNpmTasks( 'grunt-contrib-connect' );
grunt.loadNpmTasks( 'grunt-jsbeautifier' );
grunt.loadNpmTasks( 'grunt-contrib-jasmine' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.registerTask( 'test', [ 'jasmine' ] );
grunt.registerTask( 'default', [ 'uglify', 'test' ] );
grunt.registerTask( 'test', [ 'jsbeautifier:test', 'jshint', 'jasmine' ] );
grunt.registerTask( 'server', [ 'connect:server:keepalive' ] );
grunt.registerTask( 'default', [ 'test' ] );
};