/
Gruntfile.js
81 lines (68 loc) · 1.9 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
79
80
81
var path = require("path");
module.exports = function(grunt) {
var cfg = {
buildPath: path.join(__dirname, 'test', '.build'),
jshint: {
all: ["tasks/**/*.js"]
},
mochacli: {
options: {
compilers: "coffee:coffee-script",
timeout: 3000,
ignoreLeaks: false,
ui: 'bdd',
reporter: 'spec'
},
all: ['test/*.coffee']
},
"qunit-serverless": {
options: {
tmpDir: "<%= buildPath %>"
},
test: {
options: {
headerScript: "window.headerObj = true;",
includeFiles: [path.join("test", "res", "includes", "*.js")],
testFiles: [path.join("test", "res", "tests", "test*.js")],
templateFiles: [path.join("test", "res", "templates", "*.stache")]
}
},
connectBuild: {
options: {
headerScript: "window.headerObj = true;",
includeFiles: [path.join("test", "res", "includes", "*.js")],
testFiles: [path.join("test", "res", "tests", "test*.js")],
templateFiles: [path.join("test", "res", "templates", "*.stache")],
connectUrl: 'http://127.0.0.1:8000/'
}
},
fail: {
options: {
headerScript: "window.headerObj = true;",
includeFiles: [path.join("test", "res", "includes", "*.js")],
testFiles: [path.join("test", "res", "tests", "*.js")],
templateFiles: [path.join("test", "res", "templates", "*.stache")]
}
}
},
connect: {
qunit: {
options: {
port: 8000,
base: "<%= buildPath %>"
}
}
},
clean: {
build: ['test/.build/*']
}
};
grunt.initConfig(cfg);
grunt.loadNpmTasks("grunt-contrib-jshint");
grunt.loadNpmTasks("grunt-contrib-connect");
grunt.loadNpmTasks("grunt-contrib-clean");
grunt.loadNpmTasks("grunt-mocha-cli");
grunt.loadTasks("./tasks");
grunt.registerTask("test-connect", ["clean", "connect:qunit", "qunit-serverless:connectBuild"]);
grunt.registerTask("default", ["jshint:all", "mochacli:all", "qunit-serverless:test", "test-connect"]);
};