1
0
Fork 0
mirror of https://github.com/openstf/stf synced 2025-10-03 17:59:28 +02:00

Removed almost all JSHint warnings.

This commit is contained in:
Gunther Brunner 2015-10-16 18:25:32 +09:00
parent 2a5a7bae9a
commit 1e961763bd
31 changed files with 92 additions and 93 deletions

View file

@ -96,10 +96,10 @@ if (gutil.env.multi) {
protractorConfig = './res/test/protractor-appium.conf'
}
gulp.task('webdriver-update', protractor.webdriver_update)
gulp.task('webdriver-standalone', protractor.webdriver_standalone)
gulp.task('webdriver-update', protractor.webdriverUpdate)
gulp.task('webdriver-standalone', protractor.webdriverStandalone)
gulp.task('protractor-explorer', function (callback) {
protractor.protractor_explorer({
protractor.protractorExplorer({
url: require(protractorConfig).config.baseUrl
}, callback)
})

View file

@ -1,11 +1,11 @@
describe('BrowserInfo', function() {
beforeEach(angular.mock.module(require('./').name));
beforeEach(angular.mock.module(require('./').name))
it('should ...', inject(function(BrowserInfo) {
it('should ...', inject(function() {
//expect(BrowserInfo.doSomething()).toEqual('something');
}));
}))
})

View file

@ -2,7 +2,7 @@ describe('FatalMessageService', function() {
beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(FatalMessageService) {
it('should ...', inject(function() {
//expect(FatalMessageService.doSomething()).toEqual('something');

View file

@ -2,7 +2,7 @@ describe('ExternalUrlModalService', function() {
beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(ExternalUrlModalService) {
it('should ...', inject(function() {
//expect(FatalMessageService.doSomething()).toEqual('something');

View file

@ -2,7 +2,7 @@ describe('FatalMessageService', function() {
beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(FatalMessageService) {
it('should ...', inject(function() {
//expect(FatalMessageService.doSomething()).toEqual('something');

View file

@ -2,7 +2,7 @@ describe('LightboxImageService', function() {
beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(LightboxImageService) {
it('should ...', inject(function() {
//expect(XLightboxImageService.doSomething()).toEqual('something');

View file

@ -2,7 +2,7 @@ describe('SocketDisconnectedService', function() {
beforeEach(angular.mock.module(require('./index').name))
it('should ...', inject(function(SocketDisconnectedService) {
it('should ...', inject(function() {
//expect(SocketDisconnectedService.doSomething()).toEqual('something')

View file

@ -3,7 +3,7 @@ describe('VersionUpdateService', function() {
beforeEach(angular.mock.module(require('ui-bootstrap').name));
beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(VersionUpdateService) {
it('should ...', inject(function() {
//expect(VersionUpdateService.doSomething()).toEqual('something');

View file

@ -1,11 +1,11 @@
describe('FilterStringService', function() {
beforeEach(angular.mock.module(require('./').name));
beforeEach(angular.mock.module(require('./').name))
it('should ...', inject(function(FilterStringService) {
it('should ...', inject(function() {
//expect(FilterStringService.doSomething()).toEqual('something');
//expect(FilterStringService.doSomething()).toEqual('something')
}));
}))
})

View file

@ -2,9 +2,9 @@ describe('install', function() {
beforeEach(angular.mock.module(require('./').name))
it('should ...', inject(function($filter) {
it('should ...', inject(function() {
var filter = $filter('installError')
//var filter = $filter('installError')
//expect(filter('input')).toEqual('output')

View file

@ -1,11 +1,11 @@
describe('LogcatService', function() {
beforeEach(angular.mock.module(require('./').name));
beforeEach(angular.mock.module(require('./').name))
it('should ...', inject(function(LogcatService) {
it('should ...', inject(function() {
//expect(LogcatService.doSomething()).toEqual('something');
//expect(LogcatService.doSomething()).toEqual('something')
}));
}))
})

View file

@ -2,7 +2,7 @@ describe('NativeUrlService', function() {
beforeEach(angular.mock.module(require('./').name))
it('should ...', inject(function(NativeUrlService) {
it('should ...', inject(function() {
//expect(NativeUrlService.doSomething()).toEqual('something')

View file

@ -1,11 +1,10 @@
describe('PortForwardingService', function() {
beforeEach(angular.mock.module(require('./').name));
beforeEach(angular.mock.module(require('./').name))
it('should ...', inject(function(PortForwardingService) {
expect(1).toBe(1)
//expect(PortForwardingService.doSomething()).toEqual('something');
it('should ...', inject(function() {
//expect(PortForwardingService.doSomething()).toEqual('something')
}));
}))
})

View file

@ -1,11 +1,11 @@
describe('ScopedHotkeysService', function() {
beforeEach(angular.mock.module(require('./').name));
beforeEach(angular.mock.module(require('./').name))
it('should ...', inject(function(ScopedHotkeysService) {
it('should ...', inject(function() {
//expect(ScopedHotkeysService.doSomething()).toEqual('something');
//expect(ScopedHotkeysService.doSomething()).toEqual('something')
}));
}))
})

View file

@ -7,6 +7,10 @@ var frame = {
current: 0
}
function FastImageRender () {
}
var imageRender = new FastImageRender(
canvasElement
, {

View file

@ -3,8 +3,7 @@ module.exports = function screenKeyboardDirective() {
restrict: 'E',
template: require('./screen-keyboard.jade'),
link: function (scope, element) {
var input = element.find('input')
element.find('input')
}
}

View file

@ -1,7 +1,7 @@
module.exports = function screenTouchDirective() {
return {
restrict: 'A',
link: function (scope, element, attrs) {
link: function () {
}
}

View file

@ -5,7 +5,7 @@ module.exports = function textHistoryDirective() {
return {
restrict: 'A',
template: '',
link: function (scope, element, attrs) {
link: function () {
}
}

View file

@ -2,7 +2,7 @@ describe('TimelineService', function() {
beforeEach(angular.mock.module(require('./').name));
it('should ...', inject(function(TimelineService) {
it('should ...', inject(function() {
//expect(TimelineService.doSomething()).toEqual('something');

View file

@ -2,9 +2,9 @@ describe('upload', function() {
beforeEach(angular.mock.module(require('./').name))
it('should ...', inject(function($filter) {
it('should ...', inject(function() {
var filter = $filter('uploadError')
//var filter = $filter('uploadError')
//expect(filter('input')).toEqual('output')

View file

@ -1,3 +1,3 @@
module.exports = function RunJsCtrl($scope) {
module.exports = function RunJsCtrl() {
}

View file

@ -1,3 +1,3 @@
module.exports = function UsbCtrl($scope) {
module.exports = function UsbCtrl() {
}

View file

@ -36,9 +36,9 @@ describe('Control Page', function () {
})
describe('Remote Control', function () {
var RemoteCtrl = function () {
this.paneHandleHorizontal = element(by.css('.fa-pane-handle.horizontal'))
}
//var RemoteCtrl = function () {
// this.paneHandleHorizontal = element(by.css('.fa-pane-handle.horizontal'))
//}
it('should resize panel to the right', function () {
})

View file

@ -1,7 +1,7 @@
describe('Help Page', function () {
var HelpPage = function () {
this.get = function () {
browser.get(protractor.getInstance().baseUrl + 'help')
}
}
//var HelpPage = function () {
// this.get = function () {
// browser.get(protractor.getInstance().baseUrl + 'help')
// }
//}
})

View file

@ -3,7 +3,7 @@
module.exports = function FailFast() {
var passed = jasmine.getEnv().currentSpec.results().passed()
if (!passed) {
jasmine.getEnv().specFilter = function (spec) {
jasmine.getEnv().specFilter = function () {
return false
}
}

View file

@ -8,10 +8,8 @@
*/
var es = require('event-stream')
var fs = require('fs')
var path = require('path')
var child_process = require('child_process')
var async = require('async')
var childProcess = require('child_process')
var PluginError = require('gulp-util').PluginError
var winExt = /^win/.test(process.platform) ? ".cmd" : ""
var http = require('http')
@ -72,7 +70,7 @@ var protractor = function (options) {
args.unshift(options.configFile)
child =
child_process.spawn(path.resolve(getProtractorDir() + '/protractor' +
childProcess.spawn(path.resolve(getProtractorDir() + '/protractor' +
winExt), args, {
stdio: 'inherit',
env: process.env
@ -93,30 +91,30 @@ var protractor = function (options) {
})
}
var webdriver_update = function (opts, cb) {
var webdriverUpdate = function (opts, cb) {
var callback = (cb ? cb : opts)
var options = (cb ? opts : null)
var args = ["update", "--standalone"]
if (options) {
if (options.browsers) {
options.browsers.forEach(function (element, index, array) {
options.browsers.forEach(function (element) {
args.push("--" + element)
})
}
}
child_process.spawn(path.resolve(getProtractorDir() + '/webdriver-manager' +
childProcess.spawn(path.resolve(getProtractorDir() + '/webdriver-manager' +
winExt), args, {
stdio: 'inherit'
}).once('close', callback)
}
var webdriver_update_specific = function (opts) {
return webdriver_update.bind(this, opts)
var webdriverUpdateSpecific = function (opts) {
return webdriverUpdate.bind(this, opts)
}
webdriver_update.bind(null, ["ie", "chrome"])
webdriverUpdate.bind(null, ["ie", "chrome"])
var webdriver_standalone = function (opts, cb) {
var webdriverStandalone = function (opts, cb) {
var callback = (cb ? cb : opts)
var options = (cb ? opts : null)
var stdio = 'inherit'
@ -127,7 +125,7 @@ var webdriver_standalone = function (opts, cb) {
}
}
var child = child_process.spawn(path.resolve(getProtractorDir() +
var child = childProcess.spawn(path.resolve(getProtractorDir() +
'/webdriver-manager' + winExt), ['start'], {
stdio: stdio
})
@ -179,18 +177,18 @@ var isWebDriverRunning = function () {
})
}
var ensureWebDriverRunning = function () {
return new Promise(function (resolve) {
isWebDriverRunning().then(function (running) {
if (running) {
resolve()
}
})
})
}
//var ensureWebDriverRunning = function () {
// return new Promise(function (resolve) {
// isWebDriverRunning().then(function (running) {
// if (running) {
// resolve()
// }
// })
// })
//}
var protractor_explorer = function (opts, cb) {
var protractorExplorer = function (opts, cb) {
var callback = (cb ? cb : opts)
var options = (cb ? opts : null)
var url = 'https://angularjs.org/'
@ -209,7 +207,7 @@ var protractor_explorer = function (opts, cb) {
}
function runElementExplorer(callback) {
var child = child_process.spawn(path.resolve(getProtractorExplorerDir() +
var child = childProcess.spawn(path.resolve(getProtractorExplorerDir() +
'/elementexplorer.js'), [url], {
stdio: 'inherit'
})
@ -226,7 +224,7 @@ var protractor_explorer = function (opts, cb) {
if (running) {
runElementExplorer(callback)
} else {
webdriver_standalone({stdio: ['pipe', 'pipe', process.stderr]},
webdriverStandalone({stdio: ['pipe', 'pipe', process.stderr]},
function () {
})
@ -243,9 +241,9 @@ var protractor_explorer = function (opts, cb) {
module.exports = {
getProtractorDir: getProtractorDir,
protractor: protractor,
webdriver_standalone: webdriver_standalone,
webdriver_update: webdriver_update,
webdriver_update_specific: webdriver_update_specific,
protractor_explorer: protractor_explorer,
webdriverStandalone: webdriverStandalone,
webdriverUpdate: webdriverUpdate,
webdriverUpdateSpecific: webdriverUpdateSpecific,
protractorExplorer: protractorExplorer,
isWebDriverRunning: isWebDriverRunning
}

View file

@ -1,7 +1,7 @@
describe('Settings Page', function () {
var SettingsPage = function () {
this.get = function () {
browser.get(protractor.getInstance().baseUrl + 'settings')
}
}
//var SettingsPage = function () {
// this.get = function () {
// browser.get(protractor.getInstance().baseUrl + 'settings')
// }
//}
})

View file

@ -1,4 +1,3 @@
var _ = require('lodash')
var webpackConfig = require('./../../webpack.config')
var webpack = require('webpack')

View file

@ -14,4 +14,4 @@ config.capabilities = {
browserName: 'Chrome'
}
exports.config = config
module.exports.config = config

View file

@ -1,7 +1,7 @@
var config = require('./protractor.conf').config
var LoginPage = require('./e2e/login')
var HtmlReporter = require('protractor-html-screenshot-reporter')
var WaitUrl = require('./e2e/helpers/wait-url')
//var LoginPage = require('./e2e/login')
//var HtmlReporter = require('protractor-html-screenshot-reporter')
//var WaitUrl = require('./e2e/helpers/wait-url')
config.chromeOnly = false
config.capabilities = null
@ -34,4 +34,4 @@ config.multiCapabilities = [
//}
exports.config = config
module.exports.config = config

View file

@ -1,11 +1,11 @@
// Reference: https://github.com/angular/protractor/blob/master/referenceConf.js
var LoginPage = require('./e2e/login')
var BrowserLogs = require('./e2e/helpers/browser-logs')
var FailFast = require('./e2e/helpers/fail-fast')
//var FailFast = require('./e2e/helpers/fail-fast')
var HtmlReporter = require('protractor-html-screenshot-reporter')
var WaitUrl = require('./e2e/helpers/wait-url')
exports.config = {
module.exports.config = {
baseUrl: process.env.STF_URL || 'http://localhost:7100/#!/',
suites: {
control: 'e2e/control/**/*-spec.js',