From 52f6dd00dab4953c0ce8b9028491a169b7579bbb Mon Sep 17 00:00:00 2001 From: vakrilov Date: Tue, 19 May 2015 16:43:23 +0300 Subject: [PATCH 1/2] Code snippets fix --- apps/TelerikNEXT/app-view-model.ts | 2 +- apps/tests/http-tests.ts | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/apps/TelerikNEXT/app-view-model.ts b/apps/TelerikNEXT/app-view-model.ts index 12f4b0d2f..093453879 100644 --- a/apps/TelerikNEXT/app-view-model.ts +++ b/apps/TelerikNEXT/app-view-model.ts @@ -39,7 +39,7 @@ try { favourites = >JSON.parse(appSettings.getString(FAVOURITES, "[]")); } catch (error) { - console.log("Error while retrieveing favourites: " + error); + console.log("Error while retrieving favorites: " + error); favourites = new Array(); updateFavourites() } diff --git a/apps/tests/http-tests.ts b/apps/tests/http-tests.ts index c9802c4dd..22ee58dad 100644 --- a/apps/tests/http-tests.ts +++ b/apps/tests/http-tests.ts @@ -30,7 +30,9 @@ export var test_getString = function (done: (err: Error, res?: string) => void) // }, function (e) { //// Argument (e) is Error! - done(e) + // + done(e); + // }); // ``` // @@ -75,7 +77,9 @@ export var test_getJSON = function (done) { }, function (e) { //// Argument (e) is Error! //console.log(e); + // done(e); + // }); // ``` // @@ -120,7 +124,9 @@ export var test_getImage = function (done) { // }, function (e) { //// Argument (e) is Error! + // done(e); + // }); // ``` // @@ -195,7 +201,9 @@ export var test_request_responseStatusCodeShouldBeDefined = function (done) { // }, function (e) { //// Argument (e) is Error! + // done(e); + // }); // ``` // @@ -224,7 +232,9 @@ export var test_request_responseHeadersShouldBeDefined = function (done) { // }, function (e) { //// Argument (e) is Error! + // done(e); + // }); // ``` // @@ -254,7 +264,9 @@ export var test_request_responseContentShouldBeDefined = function (done) { // }, function (e) { //// Argument (e) is Error! + // done(e); + // }); // ``` // From 86511af5e7488c643631f31f0085621f4c7dd9e8 Mon Sep 17 00:00:00 2001 From: vakrilov Date: Tue, 19 May 2015 16:46:17 +0300 Subject: [PATCH 2/2] Formatting --- apps/tests/http-tests.ts | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/apps/tests/http-tests.ts b/apps/tests/http-tests.ts index 22ee58dad..fc1d144e3 100644 --- a/apps/tests/http-tests.ts +++ b/apps/tests/http-tests.ts @@ -329,7 +329,8 @@ export var test_request_headersSentAndReceivedProperly = function (done) { var result; http.request({ - url: "https://httpbin.org/get", method: "GET", + url: "https://httpbin.org/get", + method: "GET", headers: { "Content-Type": "application/json" } }).then(function (response) { result = response.headers; @@ -349,7 +350,8 @@ export var test_request_contentSentAndReceivedProperly = function (done) { var result; http.request({ - url: "https://httpbin.org/post", method: "POST", + url: "https://httpbin.org/post", + method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded" }, content: "MyVariableOne=ValueOne&MyVariableTwo=ValueTwo" }).then(function (response) { @@ -372,7 +374,8 @@ export var test_request_NonStringHeadersSentAndReceivedProperly = function (done var postData = "MyVariableOne=ValueOne&MyVariableTwo=ValueTwo"; http.request({ - url: "https://httpbin.org/post", method: "POST", + url: "https://httpbin.org/post", + method: "POST", headers: { "Content-Type": "application/x-www-form-urlencoded", "Content-Length": postData.length }, content: postData }).then(function (response) { @@ -396,7 +399,8 @@ export var test_request_jsonAsContentSentAndReceivedProperly = function (done) { var result; http.request({ - url: "https://httpbin.org/post", method: "POST", + url: "https://httpbin.org/post", + method: "POST", headers: { "Content-Type": "application/json" }, content: JSON.stringify({ MyVariableOne: "ValueOne", MyVariableTwo: "ValueTwo" }) }).then(function (response) {