From 6a60058fc616fa7a2d616af879b2e6662085c05f Mon Sep 17 00:00:00 2001 From: Sefa Ilkimen Date: Tue, 13 Oct 2020 00:22:42 +0200 Subject: [PATCH] chore: auto fix some indentations --- README.md | 4 ++-- test/e2e-specs.js | 20 ++++++++++---------- test/e2e-tooling/test.js | 6 ++++-- 3 files changed, 16 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 0fabdea..a506eea 100644 --- a/README.md +++ b/README.md @@ -407,9 +407,9 @@ cordova.plugin.http.downloadFile("https://google.com/", { ### abort Abort a HTTP request. Takes the `requestId` which is returned by [sendRequest](#sendRequest) and its shorthand functions ([post](#post), [get](#get), [put](#put), [patch](#patch), [delete](#delete), [head](#head), [uploadFile](#uploadFile) and [downloadFile](#downloadFile)). -If the request already has finished, the request will finish normally and the abort call result will be `{aborted: false}`. +If the request already has finished, the request will finish normally and the abort call result will be `{ aborted: false }`. -If the request is still in progress, the request's `failure` callback will be invoked with response `{status: -8}`, and the abort call result `{aborted: true}`. +If the request is still in progress, the request's `failure` callback will be invoked with response `{ status: -8 }`, and the abort call result `{ aborted: true }`. :warning: Not supported for Android < 6 (API level < 23). For Android 5.1 and below, calling `abort(reqestId)` will have no effect, i.e. the requests will finish as if the request was not cancelled. diff --git a/test/e2e-specs.js b/test/e2e-specs.js index 85fe9db..80e175d 100644 --- a/test/e2e-specs.js +++ b/test/e2e-specs.js @@ -85,8 +85,8 @@ const helpers = { result.type.should.be.equal(expected); }, isAbortSupported: function () { - if(window.cordova && window.cordova.platformId === 'android'){ - var version = device.version;//NOTE will throw error if cordova is present without cordova-plugin-device + if (window.cordova && window.cordova.platformId === 'android') { + var version = device.version; //NOTE will throw error if cordova is present without cordova-plugin-device var major = parseInt(/^(\d+)(\.|$)/.exec(version)[1], 10); return isFinite(major) && major >= 6; } @@ -1009,7 +1009,7 @@ const tests = [ helpers.getWithXhr(function (buffer) { var reqId = cordova.plugin.http.post('http://httpbin.org/anything', buffer, {}, resolve, reject); - setTimeout(function(){ + setTimeout(function () { cordova.plugin.http.abort(reqId); }, helpers.getAbortDelay()); @@ -1039,7 +1039,7 @@ const tests = [ }; var reqId = cordova.plugin.http.sendRequest(url, options, success, reject); - setTimeout(function(){ + setTimeout(function () { cordova.plugin.http.abort(reqId); }, helpers.getAbortDelay()); }, @@ -1071,14 +1071,14 @@ const tests = [ }, targetPath); }, reject); - setTimeout(function(){ + setTimeout(function () { cordova.plugin.http.abort(reqId); }, helpers.getAbortDelay()); }, validationFunc: function (driver, result) { - helpers.checkResult(result, 'rejected'); - result.data.status.should.be.equal(-8); + helpers.checkResult(result, 'rejected'); + result.data.status.should.be.equal(-8); } }, { @@ -1098,15 +1098,15 @@ const tests = [ var reqId = cordova.plugin.http.uploadFile(targetUrl, {}, {}, sourcePath, fileName, resolve, reject); - setTimeout(function(){ + setTimeout(function () { cordova.plugin.http.abort(reqId); }, helpers.getAbortDelay()); }, fileName, fileContent); }, validationFunc: function (driver, result) { - helpers.checkResult(result, 'rejected'); - result.data.status.should.be.equal(-8); + helpers.checkResult(result, 'rejected'); + result.data.status.should.be.equal(-8); } }, ]; diff --git a/test/e2e-tooling/test.js b/test/e2e-tooling/test.js index 6396b3f..30a7f14 100644 --- a/test/e2e-tooling/test.js +++ b/test/e2e-tooling/test.js @@ -49,13 +49,15 @@ describe('Advanced HTTP e2e test suite', function () { }); const defineTestForMocha = (test, index) => { - it(index + ': ' + test.description, async function() { + it(index + ': ' + test.description, async function () { await clickNext(driver); await validateTestIndex(driver, index); await validateTestTitle(driver, test.description); await waitToBeFinished(driver, test.timeout || 10000); + const skipped = await checkSkipped(driver); - if(skipped){ + + if (skipped) { this.skip(); } else { await validateResult(driver, test.validationFunc, targetInfo);