-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.js
executable file
·60 lines (54 loc) · 1.16 KB
/
build.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
#!/usr/local/bin/node
// Copyright (c) 2013 Titanium I.T. LLC. All rights reserved. See LICENSE.TXT for details.
"use strict";
var promisify = require("./examples/extensions/simplebuild-ext-promisify.js")
.map("../examples/mappers/simplebuild-map-header.js")
.map;
var jshint = promisify("../examples/tasks/simplebuild-jshint.js");
var mocha = promisify("../examples/tasks/simplebuild-mocha.js");
jshint.validate({
files: [ "**/*.js", "!node_modules/**/*" ],
options: lintOptions(),
globals: lintGlobals()
})
.then(function() {
return mocha.runTests({
files: [ "**/_*_test.js", "!node_modules/**/*" ]
});
})
.then(function() {
console.log("\n\nBUILD OK");
})
.fail(function(message) {
console.log("\n\nBUILD FAILED: " + message);
});
function lintOptions() {
return {
bitwise: true,
curly: false,
eqeqeq: true,
forin: true,
immed: true,
latedef: false,
newcap: true,
noarg: true,
noempty: true,
nonew: true,
regexp: true,
undef: true,
strict: true,
trailing: true,
node: true
};
}
function lintGlobals() {
return {
// Mocha
describe: false,
it: false,
before: false,
after: false,
beforeEach: false,
afterEach: false,
};
}