Skip to content

Commit

Permalink
fix soucelabs reporting code to es6
Browse files Browse the repository at this point in the history
  • Loading branch information
outsideris committed Nov 15, 2017
1 parent a260af0 commit c49c5b9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion test/e2e/initialization.test.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
const sauce = require('../libs/sauce');

module.exports = {
after: sauce.reportPassed,
after: sauce.reportResult,

'Initialization': (client) => {
/* eslint-disable */
Expand Down
18 changes: 9 additions & 9 deletions test/libs/sauce.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// from: https://github.com/RTICWDT/college-scorecard/blob/8029b46f1283ed94c7f13662689374c399ff6740/test/sauce.js
var request = require('request');
const request = require('request');

var reportPassed = function(client, done) {
const reportResult = (client, done) => {
if (!process.env.TRAVIS) { return done(); }

var user = client.options.username;
var key = client.options.accessKey;
var jobId = client.sessionId;
// console.log('client options:', client.options, '->', [user, key, jobId]);
const user = client.options.username;
const key = client.options.accessKey;
const jobId = client.capabilities['webdriver.remote.sessionid'];

if (user && key && jobId) {
var passed = client.currentTest.results.failed === 0;
const passed = client.currentTest.results.failed === 0;
console.log('* updating job status:', jobId, passed);
var url = 'https://saucelabs.com/rest/v1/' + user + '/jobs/' + jobId;
const url = 'https://saucelabs.com/rest/v1/' + user + '/jobs/' + jobId;
return request.put({
url: url,
auth: {
Expand All @@ -31,5 +31,5 @@ var reportPassed = function(client, done) {
};

module.exports = {
reportPassed: reportPassed
reportResult: reportResult
};

0 comments on commit c49c5b9

Please sign in to comment.