Skip to content
This repository was archived by the owner on Jul 24, 2019. It is now read-only.

Commit 82185ab

Browse files
committed
Lint all code, not just tests, and fix issues. Bumps eslint and request explicity
1 parent d5cb549 commit 82185ab

File tree

5 files changed

+15
-13
lines changed

5 files changed

+15
-13
lines changed

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
lib/phantom
2+
lib/location.js

.eslintrc

+2-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
]
1616
},
1717
"env": {
18-
"node": true
18+
"node": true,
19+
"phantomjs": true
1920
},
2021
"extends": "eslint:recommended"
2122
}

lib/phantomjs.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,10 @@ exports.cleanPath = function (path) {
5151
if (exports.path) {
5252
try {
5353
// avoid touching the binary if it's already got the correct permissions
54-
var st = fs.statSync(exports.path);
55-
var mode = st.mode | parseInt("0555", 8);
54+
var st = fs.statSync(exports.path)
55+
var mode = st.mode | parseInt('0555', 8)
5656
if (mode !== st.mode) {
57-
fs.chmodSync(exports.path, mode);
57+
fs.chmodSync(exports.path, mode)
5858
}
5959
} catch (e) {
6060
// Just ignore error if we don't have permission.

package.json

+5-5
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,20 @@
3636
},
3737
"scripts": {
3838
"install": "node install.js",
39-
"test": "nodeunit --reporter=minimal test/tests.js && eslint install.js"
39+
"test": "nodeunit --reporter=minimal test/tests.js && eslint ."
4040
},
4141
"dependencies": {
4242
"extract-zip": "~1.5.0",
43-
"fs-extra": "~0.26.4",
43+
"fs-extra": "~0.26.7",
4444
"hasha": "^2.2.0",
4545
"kew": "~0.7.0",
4646
"progress": "~1.1.8",
47-
"request": "~2.67.0",
47+
"request": "~2.71.0",
4848
"request-progress": "~2.0.1",
49-
"which": "~1.2.2"
49+
"which": "~1.2.4"
5050
},
5151
"devDependencies": {
52-
"eslint": "1.10.3",
52+
"eslint": "2.7.0",
5353
"nodeunit": "0.9.1"
5454
}
5555
}

test/tests.js

+3-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
var childProcess = require('child_process')
77
var fs = require('fs')
88
var path = require('path')
9-
var location = require('../lib/location')
109
var phantomjs = require('../lib/phantomjs')
1110
var util = require('../lib/util')
1211

@@ -26,7 +25,7 @@ exports.testPhantomExecutesTestScript = function (test) {
2625
'http://www.google.com/'
2726
]
2827

29-
childProcess.execFile(phantomjs.path, childArgs, function (err, stdout, stderr) {
28+
childProcess.execFile(phantomjs.path, childArgs, function (err, stdout) {
3029
var value = (stdout.indexOf('msec') !== -1)
3130
test.ok(value, 'Test script should have executed and returned run time')
3231
test.done()
@@ -36,7 +35,7 @@ exports.testPhantomExecutesTestScript = function (test) {
3635

3736
exports.testPhantomExitCode = function (test) {
3837
test.expect(1)
39-
childProcess.execFile(phantomjs.path, [path.join(__dirname, 'exit.js')], function (err, stdout, stderr) {
38+
childProcess.execFile(phantomjs.path, [path.join(__dirname, 'exit.js')], function (err) {
4039
test.equals(err.code, 123, 'Exit code should be returned from phantom script')
4140
test.done()
4241
})
@@ -50,7 +49,7 @@ exports.testBinFile = function (test) {
5049
path.join(__dirname, '..', 'lib', 'phantom', 'phantomjs.exe') :
5150
path.join(__dirname, '..', 'bin', 'phantomjs')
5251

53-
childProcess.execFile(binPath, ['--version'], function (err, stdout, stderr) {
52+
childProcess.execFile(binPath, ['--version'], function (err, stdout) {
5453
test.equal(phantomjs.version, stdout.trim(), 'Version should be match')
5554
test.done()
5655
})

0 commit comments

Comments
 (0)