mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-16 20:11:24 +08:00
Support responseType property on XMLHttpRequest.
Only default, "" and "text" supported for now. Raising an error otherwise.
This commit is contained in:
@ -616,3 +616,16 @@ export function test_raises_onerror_Event(done) {
|
||||
xhr.open("GET", "https://no-such-domain-httpbin.org");
|
||||
xhr.send();
|
||||
}
|
||||
|
||||
export function test_responseType(done) {
|
||||
let xhr = new XMLHttpRequest();
|
||||
xhr.responseType = "";
|
||||
xhr.responseType = "text";
|
||||
|
||||
TKUnit.assertThrows(
|
||||
() => xhr.responseType = "json",
|
||||
"Didn't raise on unsupported type.",
|
||||
"Response type of 'json' not supported."
|
||||
);
|
||||
done(null);
|
||||
}
|
||||
|
Reference in New Issue
Block a user