forked from stardog-union/stardog.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
29 lines (26 loc) · 1.03 KB
/
test.js
File metadata and controls
29 lines (26 loc) · 1.03 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
"use strict";
var spawn = require("win-spawn"),
loadData, runTests,
bat_script = "load_test_data.bat",
shell_script = "./load_test_data.sh",
win_run_test = "node node_modules/mocha/bin/mocha",
unix_run_test = "node_modules/mocha/bin/mocha";
if (process.platform === "win32" && process.env.SHELL === undefined) {
loadData = spawn(bat_script, [], { stdio: "inherit" });
loadData.on("exit", function (code) {
if (code !== 0) {
process.stdout.write("There was an error loading the test data.\n");
} else {
runTests = spawn(win_run_test, ["--reporter", "spec", "test/*.spec.js"], { stdio: "inherit" });
}
});
} else {
loadData = spawn(shell_script, [], { stdio: "inherit" });
loadData.on("exit", function (code) {
if (code !== 0) {
process.stdout.write("There was an error loading the test data.\n");
} else {
runTests = spawn(unix_run_test, ["--reporter", "spec", "test/*.spec.js"], { stdio: "inherit" });
}
});
}