mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
http toString will raise error if response cannot be converted to string
This commit is contained in:
@@ -53,7 +53,7 @@ export var test_getString_fail = function (done) {
|
||||
export var test_getString_fail_when_result_is_not_string = function (done) {
|
||||
var result;
|
||||
|
||||
http.getJSON({ url: "https://httpbin.org/image/png", method: "GET" }).catch(function (e) {
|
||||
http.getString({ url: "https://httpbin.org/image/png", method: "GET" }).catch(function (e) {
|
||||
result = e;
|
||||
try {
|
||||
TKUnit.assert(result instanceof Error, "Result from getString().catch() should be Error! Current type is " + typeof result);
|
||||
|
||||
Reference in New Issue
Block a user