Skip to content

Commit

Permalink
Fix issues with JSHint and make it happy
Browse files Browse the repository at this point in the history
  • Loading branch information
pangratz committed Apr 22, 2014
1 parent 12b0fab commit dc388fc
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 32 deletions.
5 changes: 2 additions & 3 deletions .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@
"requireModule",
"equal",
"test",
"testBoth",
"testWithDefault",
"raises",
"asyncTest",
"throws",
"deepEqual",
"start",
"stop",
Expand Down
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = function(grunt) {

// Build a new version of the library
this.registerTask('build', 'Builds a distributable version of <%= cfg.name %>',
['clean', 'broccoli:dist:build', 'jshint']);
['clean', 'jshint', 'broccoli:dist:build']);

config.env = process.env;
config.pkg = grunt.file.readJSON('package.json');
Expand Down
10 changes: 3 additions & 7 deletions tasks/options/jshint.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
module.exports = {
options: {
'jshintrc': '.jshintrc',
'force': true
'jshintrc': '.jshintrc'
},
dev: {
src: ["Gruntfile.js", "Brocfile.js"]
},
output: {
src: ['dist/<%= pkg.name %>.js']
src: {
src: ["Gruntfile.js", "Brocfile.js", "lib", "test/tests"]
}
};
40 changes: 20 additions & 20 deletions test/tests/router_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1151,7 +1151,7 @@ test("params are known by a transition up front", function() {
}
};

transitionTo(router, '/posts/filter/sad', 'blorg')
transitionTo(router, '/posts/filter/sad', 'blorg');
});

test("transitionTo uses the current context if you are already in a handler with a context that is not changing", function() {
Expand Down Expand Up @@ -1576,11 +1576,11 @@ asyncTest("Error handling shouldn't trigger for transitions that are already abo
handlers = {
slow_failure: {
model: function() {
return new Promise(function(res, rej){
router.transitionTo('good');
rej();
start();
});
return new Promise(function(res, rej){
router.transitionTo('good');
rej();
start();
});
},
events: {
error: function() {
Expand Down Expand Up @@ -3093,11 +3093,11 @@ module("willLeave and willChangeContext events", {

map(function(match) {
match("/people").to("people", function (match) {
match("/").to("peopleIndex");
match("/:id").to("person", function (match) {
match("/").to("personIndex");
match("/detail").to("personDetail");
});
match("/").to("peopleIndex");
match("/:id").to("person", function (match) {
match("/").to("personIndex");
match("/detail").to("personDetail");
});
});
});
}
Expand All @@ -3109,10 +3109,10 @@ asyncTest("trigger willLeave for routes that we're leaving", function() {
handlers = {
peopleIndex: {
events: {
willLeave: function(t){
ok(true, 'peopleIndex willLeave');
},
willChangeContext: function(transition) {
willLeave: function(t){
ok(true, 'peopleIndex willLeave');
},
willChangeContext: function(transition) {
ok(false, 'peopleIndex should not change context');
}
}
Expand All @@ -3122,7 +3122,7 @@ asyncTest("trigger willLeave for routes that we're leaving", function() {
willLeave: function(transition) {
ok(false, 'people should not leave');
},
willChangeContext: function(transition) {
willChangeContext: function(transition) {
ok(false, 'people should not change context');
}
}
Expand Down Expand Up @@ -3177,7 +3177,7 @@ asyncTest("doesn't trigger willChangeContext when only children change", functio
willLeave: function(transition) {
ok(false, 'people should not leave');
},
willChangeContext: function(transition) {
willChangeContext: function(transition) {
ok(false, 'people should not change context');
}
}
Expand All @@ -3187,7 +3187,7 @@ asyncTest("doesn't trigger willChangeContext when only children change", functio
willLeave: function(transition) {
ok(false, 'person should not leave');
},
willChangeContext: function(transition) {
willChangeContext: function(transition) {
ok(false, 'person should not change context');
}
}
Expand All @@ -3197,7 +3197,7 @@ asyncTest("doesn't trigger willChangeContext when only children change", functio
willLeave: function(transition) {
ok(true, 'personIndex should leave');
},
willChangeContext: function(transition) {
willChangeContext: function(transition) {
ok(false, 'personIndex should not change context');
}
}
Expand All @@ -3218,7 +3218,7 @@ asyncTest("let handlers ask which other handlers are leaving", function() {
events: {
willLeave: function(transition, alsoLeaving) {
ok(alsoLeaving("person"), "also leaving person");
ok(!alsoLeaving("people"), "not also leaving people");
ok(!alsoLeaving("people"), "not also leaving people");
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion test/tests/test_helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function module(name, options) {
}
}
});
};
}


// Helper method that performs a transition and flushes
Expand Down

0 comments on commit dc388fc

Please sign in to comment.