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

Commit

Permalink
Merge pull request #531 from avindra/master
Browse files Browse the repository at this point in the history
Lint all code, not just tests, and fix issues.
  • Loading branch information
nicks authored Jul 26, 2016
2 parents 29bce83 + 82185ab commit 9be54c5
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
lib/phantom
lib/location.js
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
]
},
"env": {
"node": true
"node": true,
"phantomjs": true
},
"extends": "eslint:recommended"
}
6 changes: 3 additions & 3 deletions lib/phantomjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ exports.cleanPath = function (path) {
if (exports.path) {
try {
// avoid touching the binary if it's already got the correct permissions
var st = fs.statSync(exports.path);
var mode = st.mode | parseInt("0555", 8);
var st = fs.statSync(exports.path)
var mode = st.mode | parseInt('0555', 8)
if (mode !== st.mode) {
fs.chmodSync(exports.path, mode);
fs.chmodSync(exports.path, mode)
}
} catch (e) {
// Just ignore error if we don't have permission.
Expand Down
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@
},
"scripts": {
"install": "node install.js",
"test": "nodeunit --reporter=minimal test/tests.js && eslint install.js"
"test": "nodeunit --reporter=minimal test/tests.js && eslint ."
},
"dependencies": {
"extract-zip": "~1.5.0",
"fs-extra": "~0.26.4",
"fs-extra": "~0.26.7",
"hasha": "^2.2.0",
"kew": "~0.7.0",
"progress": "~1.1.8",
"request": "~2.67.0",
"request": "~2.71.0",
"request-progress": "~2.0.1",
"which": "~1.2.2"
"which": "~1.2.4"
},
"devDependencies": {
"eslint": "1.10.3",
"eslint": "2.7.0",
"nodeunit": "0.9.1"
}
}
7 changes: 3 additions & 4 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
var childProcess = require('child_process')
var fs = require('fs')
var path = require('path')
var location = require('../lib/location')
var phantomjs = require('../lib/phantomjs')
var util = require('../lib/util')

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

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

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

childProcess.execFile(binPath, ['--version'], function (err, stdout, stderr) {
childProcess.execFile(binPath, ['--version'], function (err, stdout) {
test.equal(phantomjs.version, stdout.trim(), 'Version should be match')
test.done()
})
Expand Down

0 comments on commit 9be54c5

Please sign in to comment.