Skip to content

Commit

Permalink
Introduce Eslint with google's style
Browse files Browse the repository at this point in the history
  • Loading branch information
ralic committed Oct 24, 2019
1 parent c1bd111 commit 2294733
Show file tree
Hide file tree
Showing 144 changed files with 21,582 additions and 21,388 deletions.
20 changes: 20 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
'env': {
'browser': true,
'es6': true,
'node': true,
},
'extends': [
'google',
],
'globals': {
'Atomics': 'readonly',
'SharedArrayBuffer': 'readonly',
},
'parserOptions': {
'ecmaVersion': 2018,
'sourceType': 'module',
},
'rules': {
},
};
39 changes: 19 additions & 20 deletions Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
'use strict';

var packageJSON = require('./package.json');
const packageJSON = require('./package.json');

module.exports = function (grunt) {

var utils = require('./src/utils')(grunt);
var tunnelId = Math.floor((new Date()).getTime() / 1000 - 1230768000).toString();
module.exports = function(grunt) {
const utils = require('./src/utils')(grunt);
const tunnelId = Math.floor((new Date()).getTime() / 1000 - 1230768000).toString();

function negateResult(result, callback) {
// Reverses the job's passed status. Can be used as the onTestComplete callback for
// the negative tests.
var user = process.env.SAUCE_USERNAME;
var pass = process.env.SAUCE_ACCESS_KEY;
const user = process.env.SAUCE_USERNAME;
const pass = process.env.SAUCE_ACCESS_KEY;

utils
.makeRequest({
method: 'PUT',
url: ['https://saucelabs.com/rest/v1', user, 'jobs', result.job_id].join('/'),
auth: { user: user, pass: pass },
json: { passed: !result.passed }
})
.thenResolve(!result.passed)
.nodeify(callback);
.makeRequest({
method: 'PUT',
url: ['https://saucelabs.com/rest/v1', user, 'jobs', result.job_id].join('/'),
auth: {user: user, pass: pass},
json: {passed: !result.passed},
})
.thenResolve(!result.passed)
.nodeify(callback);
}

grunt.task.loadTasks('tasks');
Expand All @@ -35,14 +34,14 @@ module.exports = function (grunt) {
build: process.env.TRAVIS_JOB_ID || 'dev-'+process.env.USER+':'+Date.now(),
tags: ['v'+packageJSON.version, 'grunt-saucelabs'],
browsers: [
['Windows 7', 'chrome', '']
['Windows 7', 'chrome', ''],
],
tunneled: false,
sauceConfig: {
'video-upload-on-pass': false,
'tunnel-identifier': tunnelId
}
}
}
'tunnel-identifier': tunnelId,
},
},
},
});
};
38 changes: 19 additions & 19 deletions examples/custom/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,56 +1,56 @@
module.exports = function (grunt) {
var browsers = [{
module.exports = function(grunt) {
const browsers = [{
browserName: 'firefox',
version: '19',
platform: 'XP'
platform: 'XP',
}, {
browserName: 'googlechrome',
platform: 'XP'
platform: 'XP',
}, {
browserName: 'googlechrome',
platform: 'linux'
platform: 'linux',
}, {
browserName: 'internet explorer',
platform: 'WIN8',
version: '10'
version: '10',
}, {
browserName: 'internet explorer',
platform: 'VISTA',
version: '9'
version: '9',
}];

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
'pkg': grunt.file.readJSON('package.json'),
'connect': {
server: {
options: {
base: '',
port: 9999
}
}
port: 9999,
},
},
},

'saucelabs-custom': {
all: {
options: {
urls: [
'http://127.0.0.1:9999/index.html'
'http://127.0.0.1:9999/index.html',
],
browsers: browsers,
build: process.env.TRAVIS_JOB_ID,
testname: 'custom tests',
throttled: 3,
sauceConfig: {
'video-upload-on-pass': false
}
}
}
'video-upload-on-pass': false,
},
},
},
},
watch: {}
'watch': {},
});

grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-saucelabs');

grunt.registerTask('default', ['connect', 'saucelabs-custom']);
};
};
38 changes: 19 additions & 19 deletions examples/jasmine/Gruntfile.js
Original file line number Diff line number Diff line change
@@ -1,57 +1,57 @@
module.exports = function (grunt) {
var browsers = [{
module.exports = function(grunt) {
const browsers = [{
browserName: 'firefox',
version: '19',
platform: 'XP'
platform: 'XP',
}, {
browserName: 'googlechrome',
platform: 'XP'
platform: 'XP',
}, {
browserName: 'googlechrome',
platform: 'linux'
platform: 'linux',
}, {
browserName: 'internet explorer',
platform: 'WIN8',
version: '10'
version: '10',
}, {
browserName: 'internet explorer',
platform: 'VISTA',
version: '9'
version: '9',
}];

grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
connect: {
'pkg': grunt.file.readJSON('package.json'),
'connect': {
server: {
options: {
base: '',
port: 9999
}
}
port: 9999,
},
},
},

'saucelabs-jasmine': {
all: {
options: {
urls: [
'http://127.0.0.1:9999/SpecRunner.html',
'http://127.0.0.1:9999/SpecRunnerDos.html'
'http://127.0.0.1:9999/SpecRunnerDos.html',
],
browsers: browsers,
build: process.env.TRAVIS_JOB_ID,
testname: 'jasmine tests',
throttled: 3,
sauceConfig: {
'video-upload-on-pass': false
}
}
}
'video-upload-on-pass': false,
},
},
},
},
watch: {}
'watch': {},
});

grunt.loadNpmTasks('grunt-contrib-connect');
grunt.loadNpmTasks('grunt-saucelabs');

grunt.registerTask('default', ['connect', 'saucelabs-jasmine']);
};
};
Loading

0 comments on commit 2294733

Please sign in to comment.