-
Notifications
You must be signed in to change notification settings - Fork 22
/
Gruntfile.js
79 lines (74 loc) · 1.79 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
68
69
70
71
72
73
74
75
76
77
78
module.exports = function(grunt) {
"use strict";
grunt.initConfig({
pkg: grunt.file.readJSON("package.json"),
bowercopy: {
options: {
clean: true
},
test: {
options: {
destPrefix: "test/lib"
},
files: {
"qunit.js": "qunit/qunit/qunit.js",
"qunit.css": "qunit/qunit/qunit.css",
"require.js": "requirejs/require.js",
"sinon.js": "sinonjs-built/lib/sinon.js",
"fake_timers.js": "sinonjs-built/lib/sinon/util/fake_timers.js"
}
}
},
uglify: {
all: {
files: {
"musical.min.js": [ "musical.js" ]
},
options: {
preserveComments: false,
report: "min",
beautify: {
ascii_only: true
}
}
}
},
connect: {
testserver: {
options: {
hostname: '0.0.0.0'
}
}
},
qunit: {
all: ["test/*.html"]
},
watch: {
testserver: {
files: [],
tasks: ['connect:testserver'],
options: { atBegin: true, spawn: false }
},
},
release: {
options: {
bump: false
}
}
});
grunt.loadNpmTasks('grunt-bowercopy');
grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-qunit');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-release');
grunt.task.registerTask('test', 'Run unit tests, or just one test.',
function(testname) {
if (!!testname) {
grunt.config('qunit.all', ['test/' + testname + '.html']);
}
grunt.task.run('qunit:all');
});
grunt.registerTask("testserver", ["watch:testserver"]);
grunt.registerTask("default", ["uglify", "qunit"]);
};