Skip to content

Commit 7c3a8bd

Browse files
Fix jscs code style violations and run jscs in the test operation
I added jscs to run outside the regular build flow and make contributions easier, but I always forget to run it and several code style violations pass through.
1 parent f5d0966 commit 7c3a8bd

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Gruntfile.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ module.exports = function (grunt) {
138138
pollInterval: 10000,
139139
statusCheckAttempts: 90,
140140
throttled: 3,
141-
browsers: (function() {
141+
browsers: (function () {
142142
var browsers = {
143143
'iOS': [{
144144
browserName: 'iphone',
@@ -216,7 +216,7 @@ module.exports = function (grunt) {
216216
};
217217

218218
var matrix = [];
219-
for ( var os in browsers ) {
219+
for (var os in browsers) {
220220
matrix = matrix.concat(browsers[os]);
221221
}
222222
return matrix;
@@ -234,7 +234,7 @@ module.exports = function (grunt) {
234234
}
235235

236236
grunt.registerTask('saucelabs', ['connect:build-sauce', 'saucelabs-qunit']);
237-
grunt.registerTask('test', ['jshint', 'connect:build-qunit', 'qunit', 'nodeunit']);
237+
grunt.registerTask('test', ['jshint', 'jscs', 'connect:build-qunit', 'qunit', 'nodeunit']);
238238

239239
grunt.registerTask('dev', ['test', 'uglify', 'compare_size']);
240240
grunt.registerTask('ci', ['test', 'saucelabs']);

test/tests.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,10 @@ QUnit.test('API for changing defaults', function (assert) {
165165

166166
Cookies.defaults.path = '/foo';
167167
assert.ok(Cookies.set('c', 'v').match(/path=\/foo/), 'should use attributes from defaults');
168-
Cookies.remove( 'c', { path: '/foo' });
168+
Cookies.remove('c', { path: '/foo' });
169169

170170
assert.ok(Cookies.set('c', 'v', { path: '/bar' }).match(/path=\/bar/), 'attributes argument has precedence');
171-
Cookies.remove( 'c', { path: '/bar' });
171+
Cookies.remove('c', { path: '/bar' });
172172

173173
delete Cookies.defaults.path;
174174
assert.ok(Cookies.set('c', 'v').match(/path=\//), 'should roll back to the default path');

test/utils.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// https://github.com/axemclion/grunt-saucelabs#test-result-details-with-qunit
22
(function () {
3-
"use strict";
3+
'use strict';
44

55
var log = [];
66

@@ -54,13 +54,13 @@
5454
element[ method ](eventName, fn);
5555
};
5656

57-
window.using = function( assert ) {
57+
window.using = function (assert) {
5858
function getQuery(key) {
5959
var queries = location.href.split('?')[1];
6060
if (!queries) {
6161
return;
6262
}
63-
var pairs = queries.split( /&|=/ );
63+
var pairs = queries.split(/&|=/);
6464
var indexBaseURL = pairs.indexOf(key);
6565
var result = pairs[indexBaseURL + 1];
6666
if (result) {
@@ -69,7 +69,7 @@
6969
}
7070
function setCookie(name, value) {
7171
return {
72-
then: function(callback) {
72+
then: function (callback) {
7373
var iframe = document.getElementById('request_target');
7474
var serverURL = getQuery('integration_baseurl');
7575
Cookies.set(name, value);
@@ -87,7 +87,7 @@
8787
var iframeDocument = iframe.contentWindow.document;
8888
var root = iframeDocument.documentElement;
8989
var content = root.textContent;
90-
if ( !content ) {
90+
if (!content) {
9191
ok(false, [
9292
'"' + requestURL + '"',
9393
'content should not be empty'

0 commit comments

Comments
 (0)