Skip to content
Browse files

Added lint configuration

  - Still a long way to go
  • Loading branch information...
1 parent 13e2159 commit 6177d0ea50253b7a705811ee86def2dc4eb76ea2 Christian Johansen committed Jan 30, 2012
Showing with 41 additions and 7 deletions.
  1. +31 −0 autolint.json
  2. +10 −7 lib/buster-test-cli/browser/wiring.js
View
31 autolint.json
@@ -0,0 +1,31 @@
+{
+ "paths": [
+ "lib/*.js",
+ "lib/buster-test-cli/*.js",
+ "lib/buster-test-cli/browser/*.js",
+ "lib/buster-test-cli/cli/*.js",
+ "lib/buster-test-cli/server/*.js",
+ "lib/buster-test-cli/test-runner/*.js",
+ "test/*.js",
+ "test/browser/*.js",
+ "test/node/*.js",
+ "test/node/integration/*.js",
+ "test/node/unit/*.js",
+ "test/node/unit/cli/*.js",
+ "test/node/unit/cli/runners/*.js",
+ "test/node/unit/test-runner/*.js"
+ ],
+ "linterOptions": {
+ "node": true,
+ "onevar": false,
+ "plusplus": false,
+ "nomen": false,
+ "forin": true,
+ "regexp": false,
+ "predef": [
+ "assert",
+ "refute",
+ "buster"
+ ]
+ }
+}
View
17 lib/buster-test-cli/browser/wiring.js
@@ -1,8 +1,10 @@
+/*jslint browser: true*/
(function (B) {
function catchUncaughtErrors(emitter) {
window.onerror = function (message) {
emitter.emit("uncaughtException", {
- name: "UncaughtError", message: message
+ name: "UncaughtError",
+ message: message
});
return true;
@@ -25,22 +27,23 @@
}
function connectTestRunner(emitter) {
- var contexts = collectTestCases();
+ var ctxts = collectTestCases();
var ready, started, config;
function startRun() {
- if (!ready || !started) return;
+ if (!ready || !started) { return; }
var runner = B.testRunner.create(config);
var reporter = B.reporters.jsonProxy.create(emitter);
reporter.listen(runner);
- runner.runSuite(buster.testContext.compile(contexts, config.filters));
+ runner.runSuite(buster.testContext.compile(ctxts, config.filters));
}
emitter.on("tests:run", function (msg) {
- var data = msg && msg.data || {};
+ var data = (msg && msg.data) || {};
config = data;
ready = true;
- started = started || !data.hasOwnProperty("autoRun") || data.autoRun;
+ var autoRun = !data.hasOwnProperty("autoRun") || data.autoRun;
+ started = started || autoRun;
startRun();
});
@@ -95,7 +98,7 @@
B.nextTick = function (cb) {
i += 1;
- if (i == 10) {
+ if (i === 10) {
setTimeout(function () {
cb();
}, 0);

0 comments on commit 6177d0e

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