Update ci script to pass linting

This commit is contained in:
Gregg Van Hove
2019-06-12 12:15:34 -07:00
parent c73c5a9dbd
commit 0f4e53d0e6

View File

@@ -1,16 +1,14 @@
const path = require("path"),
fs = require('fs'),
util = require('util'),
jasmineBrowser = require('jasmine-browser-runner'),
ConsoleReporter = require('jasmine').ConsoleReporter,
jasmineCore = require('../../lib/jasmine-core'),
useSauce = process.env.USE_SAUCE === 'true';
/* eslint-env node, es6 */
const path = require('path'),
jasmineBrowser = require('jasmine-browser-runner'),
jasmineCore = require('../../lib/jasmine-core'),
useSauce = process.env.USE_SAUCE === 'true';
var config = require(path.resolve('spec/support/jasmine-browser.json'));
config.jasmineCore = jasmineCore;
function buildWebdriver() {
const webdriver = require("selenium-webdriver"),
const webdriver = require('selenium-webdriver'),
Capability = webdriver.Capability;
if (useSauce) {
const username = process.env['SAUCE_USERNAME'],
@@ -23,26 +21,32 @@ function buildWebdriver() {
[Capability.VERSION]: process.env['SAUCE_BROWSER_VERSION'],
build: `Core ${process.env['TRAVIS_BUILD_NUMBER'] || 'Ran locally'}`,
tags: ['Jasmine-Core'],
"tunnel-identifier": process.env['TRAVIS_JOB_NUMBER'] ? process.env['TRAVIS_JOB_NUMBER'].toString() : null
'tunnel-identifier': process.env['TRAVIS_JOB_NUMBER']
? process.env['TRAVIS_JOB_NUMBER'].toString()
: null
})
.usingServer(`http://${username}:${accessKey}@localhost:4445/wd/hub`)
.build();
} else {
return new webdriver.Builder()
.forBrowser(process.env["JASMINE_BROWSER"] || "firefox")
.forBrowser(process.env['JASMINE_BROWSER'] || 'firefox')
.build();
}
}
const driver = buildWebdriver();
jasmineBrowser.runSpecs(config, driver).then(function(runDetails) {
process.exitCode = runDetails.overallStatus === 'passed' ? 0 : 1;
jasmineBrowser
.runSpecs(config, driver)
.then(function(runDetails) {
process.exitCode = runDetails.overallStatus === 'passed' ? 0 : 1;
if (useSauce) {
driver.executeScript(`sauce:job-result=${process.exitCode === 0}`);
}
}).catch(error => {
console.error(error);
}).then(function () {
return driver ? driver.close() : true;
});
if (useSauce) {
driver.executeScript(`sauce:job-result=${process.exitCode === 0}`);
}
})
.catch(error => {
console.error(error);
})
.then(function() {
return driver ? driver.close() : true;
});