This repository was archived by the owner on Mar 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathJakefile
More file actions
81 lines (68 loc) · 2.28 KB
/
Jakefile
File metadata and controls
81 lines (68 loc) · 2.28 KB
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 fs = require("fs"),
url = require("url"),
path = require("path"),
async = require("async"),
http = require("http"),
request = require("request"),
Handlebars = require("handlebars"),
_ = require("underscore")
require("coffee-script")
var ROOT_DIRECTORY = path.normalize(__dirname)
var WORK_DIRECTORY = path.join(ROOT_DIRECTORY, ".work")
var RUN_DIRECTORY = path.join(WORK_DIRECTORY, "pid")
var DB_DIRECTORY = path.join(WORK_DIRECTORY, "data")
var LOG_DIRECTORY = path.join(WORK_DIRECTORY, "log")
var SHARPNODES = {
root: ROOT_DIRECTORY,
pid: path.join(RUN_DIRECTORY, "sharpnodes.pid"),
log: path.join(LOG_DIRECTORY, "sharpnodes.log"),
host: "127.0.0.1",
port: 3000
}
var MONGO = {
root: DB_DIRECTORY,
pid: path.join(RUN_DIRECTORY, "mongo.pid"),
log: path.join(LOG_DIRECTORY, "mongo.log"),
host: "127.0.0.1",
port: 27017
}
desc("Start the app on port 3000")
task({"start": []}, function() {
var app = require('./sharpnodes.coffee');
app.start({ "port": 3000 });
})
desc("Start the app for the tests")
task({"tests-start": []}, function() {
var app = require('./sharpnodes.coffee');
app.start({ "port": 3000, "db": 'mongodb://localhost/sharpnodes_test' });
})
desc("Open a console")
task({"console": ["tests-start"]}, function() {
repl = require('./node_modules/coffee-script/lib/repl.js')
})
desc("Run all specs")
task({"spec": ["tests-start"]}, function() {
var path = require("path"),
jasmine = require("./spec/lib/jasmine-node"),
specFolderPath = path.join(ROOT_DIRECTORY, "spec", "src"),
showColors = true,
isVerbose = true,
filter = /\.(js|coffee)$/
SHARPNODES.url = "http://" + SHARPNODES.host + ":" + SHARPNODES.port
jasmine.SHARPNODES = SHARPNODES
jasmine.MONGO = MONGO
if (arguments.length > 0) {
filter = new RegExp(
_(Array.prototype.slice.call(arguments, 0)).map(function(suite) {
return suite + "\\.js$"
}).join("|")
)
}
jasmine = require("./spec/lib/jasmine-request")(jasmine)
jasmine.request.target(SHARPNODES.url)
jasmine.DEFAULT_TIMEOUT_INTERVAL = 500;
for (var key in jasmine) global[key] = jasmine[key]
jasmine.executeSpecsInFolder(specFolderPath, function(runner, log) {
process.exit(runner.results().failedCount)
}, isVerbose, showColors, filter)
})