Permalink
Browse files

Pass lint

  • Loading branch information...
1 parent 4e4768f commit af0c654308c630eb92aaa98cc8e31c4be31828c2 @superbrothers committed Feb 1, 2014
Showing with 9 additions and 3 deletions.
  1. +3 −3 lib/capturejs.js
  2. +6 −0 test/test_capturejs.js
View
@@ -5,7 +5,7 @@
var phantom = require('phantom');
module.exports.capture = function (option, callback) {
- callback = callback || function () {};
+ callback = callback || function () { return undefined; };
var args = [],
phantomHandler;
@@ -50,7 +50,7 @@ module.exports.capture = function (option, callback) {
});
}
- if (typeof timer !== 'undefined') {
+ if (timer !== undefined) {
clearTimeout(timer);
}
@@ -68,7 +68,7 @@ module.exports.capture = function (option, callback) {
page.evaluate((function () {
var func = function (selector) {
document.body.bgColor = 'white';
- if (typeof selector === 'undefined') {
+ if (selector === undefined) {
return null;
}
var elem = document.querySelector(selector);
@@ -39,6 +39,9 @@ module.exports = {
delay = u.query.responsetime || 0;
setTimeout(function () {
fs.readFile(path.join(__dirname, 'test.html'), 'utf8', function (err, data) {
+ if (err) {
+ throw err;
+ }
res.writeHead('200', {
'Content-Type': 'text/html',
'Set-Cookie': 'cookie=test'
@@ -61,6 +64,7 @@ module.exports = {
}, function () {
setTimeout(function () {
async.map([expected, actual], md5sum, function (err, results) {
+ test.ok(!err);
test.equal(results[0], results[1], expected + ' eq ' + actual);
test.done();
});
@@ -77,6 +81,7 @@ module.exports = {
}, function () {
setTimeout(function () {
async.map([expected, actual], md5sum, function (err, results) {
+ test.ok(!err);
test.equal(results[0], results[1], expected + ' eq ' + actual);
test.done();
});
@@ -93,6 +98,7 @@ module.exports = {
}, function () {
setTimeout(function () {
async.map([expected, actual], md5sum, function (err, results) {
+ test.ok(!err);
test.equal(results[0], results[1], expected + ' eq ' + actual);
test.done();
});

0 comments on commit af0c654

Please sign in to comment.