Skip to content

Commit

Permalink
kill all the jshint error things
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-bromann committed Jun 24, 2015
1 parent 2d1adc0 commit 35b2fcc
Show file tree
Hide file tree
Showing 78 changed files with 275 additions and 308 deletions.
2 changes: 1 addition & 1 deletion .jshintignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
**/node_modules
*.min.js
test/site
6 changes: 5 additions & 1 deletion .jshintrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"node": true,
"quotmark": "single",
"trailing": true,
"expr": true,
"globals": {
"$": true,
"jQuery": true,
Expand All @@ -20,6 +21,9 @@
"h": true,
"conf": true,
"document": true,
"window": true
"window": true,
"expect": true,
"afterEach": true,
"jasmine": true
}
}
2 changes: 1 addition & 1 deletion examples/buster.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ config['My tests'] = {
tests: [
'examples/webdriverjs.with.buster.js'
]
}
};
2 changes: 1 addition & 1 deletion examples/cucumber/features/step-definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
var webdriverjs = require('../../../index'),
assert = require('assert');

var sharedSteps = module.exports = function(){
module.exports = function(){

var client = webdriverjs.remote({ desiredCapabilities: {browserName: 'phantomjs'}, logLevel: 'silent' }),
tmpResult = null;
Expand Down
4 changes: 2 additions & 2 deletions examples/webdriverio.addCommand.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
var webdriverio = require('../index');
var helper = require('./webdriverio.externalAddCommandHelper')
var helper = require('./webdriverio.externalAddCommandHelper');

var options = {
desiredCapabilities: {
browserName: 'chrome'
}
};
client = webdriverio.remote(options);
var client = webdriverio.remote(options);
client.addCommand('searchGoogle',helper.searchGoogle.bind(client));

var SearchString = 'webdriver.io';
Expand Down
3 changes: 1 addition & 2 deletions examples/webdriverio.multiremote.chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ var WebdriverIO = require('../'),
browserB: { desiredCapabilities: { browserName: 'firefox' } }
}),
browserA = matrix.select('browserA'),
browserB = matrix.select('browserB'),
name;
browserB = matrix.select('browserB');

/**
* open chat application
Expand Down
8 changes: 4 additions & 4 deletions examples/webdriverio.multiremote.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ var WebdriverIO = require('../'),
browserName: 'chrome',
chromeOptions: {
args: [
"use-fake-device-for-media-stream",
"use-fake-ui-for-media-stream",
'use-fake-device-for-media-stream',
'use-fake-ui-for-media-stream',
]
}
}
Expand All @@ -16,8 +16,8 @@ var WebdriverIO = require('../'),
browserName: 'chrome',
chromeOptions: {
args: [
"use-fake-device-for-media-stream",
"use-fake-ui-for-media-stream",
'use-fake-device-for-media-stream',
'use-fake-ui-for-media-stream',
]
}
}
Expand Down
3 changes: 1 addition & 2 deletions examples/webdriverio.selectBy.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* http://thenostalgiamachine.com/ */

var webdriverio = require('../index'),
Q = require('q');
var webdriverio = require('../index');

var options = {
desiredCapabilities: {
Expand Down
2 changes: 1 addition & 1 deletion examples/webdriverio.selectorExecuteAsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ webdriverio
.timeoutsAsyncScript(5000)
.selectorExecuteAsync('//div', function(inputs, message, callback){

setTimeout(callback.bind(null, inputs.length + ' ' + message), 2500)
setTimeout(callback.bind(null, inputs.length + ' ' + message), 2500);

}, 'divs on the page')
.then(function(res){
Expand Down
3 changes: 1 addition & 2 deletions examples/webdriverio.waitForVisible.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
var webdriverio = require('../index'),
Q = require('q');
var webdriverio = require('../index');

var options = {
desiredCapabilities: {
Expand Down
9 changes: 5 additions & 4 deletions examples/webdriverio.with.buster.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
var buster = require("buster"),
var buster = require('buster'),
assert = buster.referee.assert,
webdriverio = require('../index');
webdriverio = require('../index'),
client;

buster.testCase('Nested setup and teardown call order', {

buster.testCase("Nested setup and teardown call order", {

'setUp': function (done) {
this.timeout = 5000;
client = webdriverio.remote({ desiredCapabilities: {browserName: 'firefox'} });
Expand Down
1 change: 0 additions & 1 deletion examples/webdriverio.with.mocha.and.chai.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
var chai = require('chai'),
assert = chai.assert,
expect = chai.expect,
webdriverio = require('../index');

describe('my webdriverio tests', function(){
Expand Down
2 changes: 1 addition & 1 deletion examples/webdriverio.with.nodeunit.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
var webdriverio = require('../index'),
assert = require('assert');
client;

module.exports = {

Expand Down
15 changes: 7 additions & 8 deletions examples/webdriverio.with.vows.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var vows = require('vows'),
assert = require('assert'),
webdriverio = require('../index'),
fs = require('fs');
webdriverio = require('../index');

var client;

Expand All @@ -17,17 +16,17 @@ vows.describe('my github tests').addBatch({

'starting webdriverio successfully': {

topic: function (init) {
topic: function () {
client.url('https://github.com/', this.callback);
},

'check logo dimension': {

topic: function (url) {
topic: function () {
client.getElementSize('.header-logo-wordmark', this.callback);
},

'getElementSize() should cause no error': function(err,result) {
'getElementSize() should cause no error': function(err) {
assert(err === null);
},

Expand All @@ -47,7 +46,7 @@ vows.describe('my github tests').addBatch({
client.getTitle(this.callback);
},

'getTitle() should cause no error': function(err,result) {
'getTitle() should cause no error': function(err) {
assert(err === null);
},

Expand All @@ -63,7 +62,7 @@ vows.describe('my github tests').addBatch({
client.getCssProperty('a[href="/plans"]', 'color', this.callback);
},

'getElementCssProperty() should cause no error': function(err,result) {
'getElementCssProperty() should cause no error': function(err) {
assert(err === null);
},

Expand All @@ -80,7 +79,7 @@ vows.describe('my github tests').addBatch({
client.end(this.callback);
},

'should end successfully': function(err,result) {
'should end successfully': function(err) {
assert(err === null);
}

Expand Down
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ module.exports.version = package.version;
module.exports.ErrorHandler = ErrorHandler;

// use the chained API reference to add static methods
var remote = module.exports.remote = function remote(options) {
module.exports.remote = function remote(options) {

options = options || {};

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/addValue.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = function addValue (selector, value) {
* parameter check
*/
if(typeof value === 'number') {
value = '' + value
value = '' + value;
}

if(typeof value !== 'string' && !Array.isArray(value)) {
Expand Down
3 changes: 0 additions & 3 deletions lib/commands/clearElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ var ErrorHandler = require('../utils/ErrorHandler.js');

module.exports = function clearElement (selector) {

var self = this,
response = {};

return this.elements(selector).then(function(res) {

if(!res.value || res.value.length === 0) {
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/debug.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = function debug () {
this.logger.logLevel = 'verbose';
this.logger.debug();

rl.question('', function(answer) {
rl.question('', function() {
this.logger.logLevel = logLevel;
rl.close();
defer.resolve();
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/endAll.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ module.exports = function endAll () {
sessionCommands = [];

res.value.forEach(function(session) {
sessionCommands.push(self.session('delete', session.id))
sessionCommands.push(self.session('delete', session.id));
});

return this.unify(sessionCommands);
Expand Down
4 changes: 2 additions & 2 deletions lib/commands/getAttribute.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ module.exports = function getAttribute (selector, attributeName) {
elementIdAttributeCommands = [];

res.value.forEach(function(elem) {
elementIdAttributeCommands.push(self.elementIdAttribute(elem.ELEMENT, attributeName))
})
elementIdAttributeCommands.push(self.elementIdAttribute(elem.ELEMENT, attributeName));
});

return this.unify(elementIdAttributeCommands, true);

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/getCookie.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = function getCookie (name) {
})[0] || null;
}

return res.value || (typeof name === 'string' ? null : [])
return res.value || (typeof name === 'string' ? null : []);

});

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/getCssProperty.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ module.exports = function getCssProperty (selector, cssProperty) {

res.value.forEach(function(elem) {
elementIdCssPropertyCommands.push(self.elementIdCssProperty(elem.ELEMENT, cssProperty));
})
});

return Q.all(elementIdCssPropertyCommands);

Expand Down
4 changes: 2 additions & 2 deletions lib/commands/getElementSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,10 @@ module.exports = function getElementSize (selector, prop) {
elementIdSizeCommands = [];

res.value.forEach(function(elem) {
elementIdSizeCommands.push(self.elementIdSize(elem.ELEMENT))
elementIdSizeCommands.push(self.elementIdSize(elem.ELEMENT));
});

return Q.all(elementIdSizeCommands)
return Q.all(elementIdSizeCommands);

}).then(function(sizes) {

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/getHTML.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = function getHTML(selector, includeSelectorTag) {

// throw NoSuchElement error if no element was found
if (!html) {
err = new ErrorHandler(7);
throw new ErrorHandler(7);
}

return html && html.length === 1 ? html[0] : html;
Expand Down
3 changes: 0 additions & 3 deletions lib/commands/hold.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ module.exports = function hold (selector) {
throw new ErrorHandler.CommandError('hold command is not supported on non mobile platforms');
}

var self = this,
response = {};

return this.element(selector).then(function(res) {
return this.touchLongClick(res.value.ELEMENT);
});
Expand Down
3 changes: 1 addition & 2 deletions lib/commands/isExisting.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,10 @@
*
*/

var ErrorHandler = require('../utils/ErrorHandler.js');

module.exports = function isExisting (selector) {

return this.elements(selector).then(function(res) {

if(res.value && res.value instanceof Array && res.value.length > 0) {
return true;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/selectorExecuteAsync.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var ensureClientS = require('../helpers/ensureClientSideSelectorSupport'),
module.exports = function selectorExecuteAsync(selector, script) {
var args = Array.prototype.slice.call(arguments, 2);

if(typeof selector === "string") {
if(typeof selector === 'string') {
selector = [selector];
}

Expand Down
2 changes: 1 addition & 1 deletion lib/commands/setViewportSize.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
*/


var getViewportSizeHelper = require('../helpers/_getViewportSize')
var getViewportSizeHelper = require('../helpers/_getViewportSize'),
ErrorHandler = require('../utils/ErrorHandler.js');

module.exports = function setViewportSize (size) {
Expand Down
2 changes: 0 additions & 2 deletions lib/commands/submitForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
*
*/

var ErrorHandler = require('../utils/ErrorHandler.js');

module.exports = function submitForm (selector) {

return this.element(selector).then(function(res) {
Expand Down
3 changes: 0 additions & 3 deletions lib/commands/touch.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ module.exports = function touch (selector) {
throw new ErrorHandler.CommandError('touch command is not supported on non mobile platforms');
}

var self = this,
response = {};

return this.getLocation(selector).then(function(val) {
return this.touchDown(val.x, val.y);
});
Expand Down
Loading

0 comments on commit 35b2fcc

Please sign in to comment.