Skip to content

Commit

Permalink
Merge pull request #783 from AviVahl/replace-request-with-got
Browse files Browse the repository at this point in the history
chore(deps): replace "request" with "got"
  • Loading branch information
VerteDinde authored Nov 30, 2020
2 parents 87a00b7 + 495f7d8 commit f4d097a
Show file tree
Hide file tree
Showing 3 changed files with 195 additions and 364 deletions.
16 changes: 5 additions & 11 deletions lib/chrome-driver.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const ChildProcess = require('child_process');
const path = require('path');
const request = require('request');
const { default: got } = require('got');
const split = require('split');

function ChromeDriver(
Expand Down Expand Up @@ -122,16 +122,10 @@ ChromeDriver.prototype.stop = function () {

ChromeDriver.prototype.isRunning = function (callback) {
const cb = false;
const requestOptions = {
uri: this.statusUrl,
json: true,
followAllRedirects: true
};
request(requestOptions, function (error, response, body) {
if (error) return callback(cb);
if (response.statusCode !== 200) return callback(cb);
callback(body && body.value.ready);
});
got(this.statusUrl)
.json()
.then(({ value }) => callback(value && value.ready))
.catch(() => callback(cb));
};

ChromeDriver.prototype.getLogs = function () {
Expand Down
Loading

0 comments on commit f4d097a

Please sign in to comment.