mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Merge branch 'master'
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* tslint:disable:no-unused-variable */
|
||||
import * as TKUnit from "../TKUnit";
|
||||
import * as types from "tns-core-modules/utils/types";
|
||||
import * as TKUnit from "../tk-unit";
|
||||
import * as types from "@nativescript/core/utils/types";
|
||||
|
||||
export var test_fetch_defined = function () {
|
||||
TKUnit.assert(types.isDefined((fetch)), "Method fetch() should be defined!");
|
||||
@@ -56,11 +56,11 @@ export var test_fetch_formData = function (done: (err: Error, res?: string) => v
|
||||
|
||||
export var test_fetch_fail_invalid_url = function (done) {
|
||||
var completed: boolean;
|
||||
var isReady = function () { return completed; }
|
||||
var isReady = function () { return completed; };
|
||||
|
||||
fetch("hgfttp://httpbin.org/get").catch(function (e) {
|
||||
completed = true;
|
||||
done(null)
|
||||
done(null);
|
||||
}).catch(failOnError(done));
|
||||
};
|
||||
|
||||
@@ -145,4 +145,4 @@ export var test_fetch_post_json = function (done) {
|
||||
|
||||
const failOnError = function (done: (err: Error, res?: string) => void) {
|
||||
return e => done(e);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user