Skip to content
Browse files

Customization refactoring

  • Loading branch information...
1 parent fa8ba26 commit afe147cafda65bd1520202c4e288357a052148a5 @cjohansen cjohansen committed Aug 14, 2012
Showing with 26 additions and 16 deletions.
  1. +1 −1 bin/buster
  2. +7 −2 bin/buster-server
  3. +3 −13 bin/buster-test
  4. +2 −0 lib/buster/buster-wiring.js
  5. +13 −0 lib/buster/wiring-extension.js
View
2 bin/buster
@@ -48,7 +48,7 @@ function runBusterCmd(cmd) {
} else {
var mod = stdout.split("\n")[0];
- var run = childProcess.spawn(mod, argv, {env: process.env, setsid: true});
+ var run = childProcess.spawn(mod, argv, { env: process.env, setsid: true });
run.stdout.on('data', function (data) {
process.stdout.write(data);
});
View
9 bin/buster-server
@@ -1,6 +1,11 @@
#!/usr/bin/env node
require("buster-server-cli").create(process.stdout, process.stderr, {
- missionStatement: "Server for automating JavaScript test runs across browsers",
- description: "buster-server [options]"
+ name: "Buster.<span>JS</span>",
+ binary: "buster-server",
+ description: "buster-server [options]",
+ missionStatement: "Server for automating Buster.JS test runs across browsers",
+ unexpectedErrorMessage: "Something went horribly wrong. This is most likely " +
+ "a bug, please report at\n" +
+ "http://github.com/busterjs/buster/issues\n"
}).run(process.argv.slice(2));
View
16 bin/buster-test
@@ -7,7 +7,6 @@ process.on("uncaughtException", function (err) {
});
var busterPath = path.join(__dirname, "..", "lib", "buster");
-var frameworkExt = path.join(busterPath, "framework-extension");
testCli.create(process.stdout, process.stderr, {
missionStatement: "Run Buster.JS tests on node, in browsers, or both",
@@ -19,23 +18,14 @@ testCli.create(process.stdout, process.stderr, {
].join("\n"),
environmentVariable: "BUSTER_TEST_OPT",
runners: testCli.runners,
+ configBaseName: "buster",
extensions: {
browser: [
- require(frameworkExt),
- { configure: function (config) { loadWiring(config); } },
+ require(path.join(busterPath, "framework-extension")),
+ require(path.join(busterPath, "wiring-extension")),
require("buster-syntax").create({ ignoreReferenceErrors: true })
]
}
}).run(process.argv.slice(2), function (err) {
if (err) { process.exit(1); }
});
-
-function loadWiring(configuration) {
- configuration.on("load:framework", function (rs) {
- rs.addFileResource(path.join(busterPath, "capture-server-wiring.js"), {
- path: "/buster/capture-server-wiring.js"
- }).then(function () {
- rs.loadPath.append("/buster/capture-server-wiring.js");
- });
- });
-}
View
2 lib/buster/buster-wiring.js
@@ -6,6 +6,8 @@
assertions: require("buster-assertions"),
format: require("buster-format"),
eventedLogger: require("buster-evented-logger")
+ frameworkExtension: require("./framework-extension"),
+ wiringExtension: require("./wiring-extension")
});
buster.defineVersionGetter(module.exports, __dirname);
View
13 lib/buster/wiring-extension.js
@@ -0,0 +1,13 @@
+var path = require("path");
+
+module.exports = {
+ configure: function (configuration) {
+ configuration.on("load:framework", function (rs) {
+ rs.addFileResource(path.join(__dirname, "capture-server-wiring.js"), {
+ path: "/buster/capture-server-wiring.js"
+ }).then(function () {
+ rs.loadPath.append("/buster/capture-server-wiring.js");
+ });
+ });
+ }
+};

0 comments on commit afe147c

Please sign in to comment.
Something went wrong with that request. Please try again.