Commit 96e37bf1 96e37bf1d689c4acd740baa42c7ed52675eeac58 by Nicolas Perriault

refs #246 - jshint added to travis-ci build configuration

1 parent 2276b8d6
......@@ -9,6 +9,7 @@
"maxdepth": 3,
"maxstatements": 15,
"maxcomplexity": 7,
"proto": true,
"regexdash": true,
"strict": true,
"sub": true,
......
......@@ -2,12 +2,13 @@ branches:
only:
- master
before_script:
- "npm install -g jshint"
- "phantomjs --version"
- "export PHANTOMJS_EXECUTABLE='phantomjs --local-to-remote-url-access=yes --ignore-ssl-errors=yes'"
- "export DISPLAY=:99.0"
- "sh -e /etc/init.d/xvfb start"
script:
- "DISPLAY=:99.0 ./bin/casperjs selftest"
- "./bin/casperjs selftest"
after_script:
- "jshint --config=.jshintconfig ."
notifications:
irc:
channels:
......
......@@ -926,6 +926,7 @@ Casper.prototype.getTitle = function getTitle() {
*/
Casper.prototype.handleReceivedResource = function(resource) {
"use strict";
/*jshint maxstatements:20*/
if (resource.stage !== "end") {
return;
}
......@@ -1109,6 +1110,7 @@ Casper.prototype.mouseEvent = function mouseEvent(type, selector) {
*/
Casper.prototype.open = function open(location, settings) {
"use strict";
/*jshint maxstatements:30*/
var baseCustomHeaders = this.page.customHeaders,
customHeaders = settings && settings.headers || {};
this.checkStarted();
......@@ -1297,6 +1299,7 @@ Casper.prototype.setHttpAuth = function setHttpAuth(username, password) {
*/
Casper.prototype.start = function start(location, then) {
"use strict";
/*jshint maxstatements:30*/
this.emit('starting');
this.log('Starting...', "info");
this.startTime = new Date().getTime();
......
......@@ -41,6 +41,7 @@
* Casper client-side helpers.
*/
exports.ClientUtils = function ClientUtils(options) {
/*jshint maxstatements:30*/
// private members
var BASE64_ENCODE_CHARS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
var BASE64_DECODE_CHARS = new Array(
......@@ -200,6 +201,7 @@
* @return Object An object containing setting result for each field, including file uploads
*/
this.fill = function fill(form, vals) {
/*jshint maxcomplexity:8*/
var out = {
errors: [],
fields: [],
......@@ -606,6 +608,7 @@
* @param mixed value The field value to set
*/
this.setField = function setField(field, value) {
/*jshint maxcomplexity:99 */
var logValue, fields, out;
value = logValue = (value || "");
if (field instanceof NodeList) {
......
......@@ -62,6 +62,7 @@ responseHeaders.prototype.get = function get(name){
*/
exports.augmentResponse = function(response) {
"use strict";
/*jshint proto:true*/
if (!utils.isHTTPResource(response)) {
return;
}
......
/*global casper*/
/*global casper __utils__*/
/*jshint strict:false*/
casper.start('tests/site/frames.html', function() {
this.test.assertTitle('CasperJS test frames');
......
......@@ -13,7 +13,7 @@ var t = casper.test, current = 0, tests = [
},
function(request) {
t.assertNot(request.headers.some(testHeader), "Casper.open() custom headers option is not persistent");
},
}
];
casper.on('page.resource.requested', function(request) {
......
/*global casper*/
/*jshint strict:false*/
/*jshint strict:false maxstatements:99*/
var cli = require('cli'), t = casper.test;
t.comment('parse(), get(), has()');
......