mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
sinon: move incorrect xhr restore method (#26119)
This commit is contained in:
committed by
Mohamed Hegazy
parent
4757d2b37c
commit
38df6613ce
Vendored
+1
-1
@@ -271,7 +271,6 @@ declare namespace Sinon {
|
||||
getAllResponseHeaders(): any;
|
||||
|
||||
// Methods
|
||||
restore(): void;
|
||||
setResponseHeaders(headers: any): void;
|
||||
setResponseBody(body: string): void;
|
||||
respond(status: number, headers: any, body: string): void;
|
||||
@@ -285,6 +284,7 @@ declare namespace Sinon {
|
||||
useFilters: boolean;
|
||||
addFilter(filter: (method: string, url: string, async: boolean, username: string, password: string) => boolean): void;
|
||||
onCreate(xhr: SinonFakeXMLHttpRequest): void;
|
||||
restore(): void;
|
||||
}
|
||||
|
||||
interface SinonFakeServer extends SinonFakeServerOptions {
|
||||
|
||||
@@ -40,6 +40,7 @@ function testSandbox() {
|
||||
|
||||
const xhr = sb.useFakeXMLHttpRequest();
|
||||
xhr.useFilters = true;
|
||||
xhr.restore();
|
||||
|
||||
const server = sb.useFakeServer();
|
||||
server.respondWith('foo');
|
||||
@@ -98,7 +99,6 @@ function testXHR() {
|
||||
const headers = xhr.getAllResponseHeaders();
|
||||
const header = xhr.getResponseHeader('foo');
|
||||
|
||||
xhr.restore();
|
||||
xhr.setResponseHeaders({ 'Content-Type': 'text/html' });
|
||||
xhr.setResponseBody('foo');
|
||||
xhr.respond(200, { 'Content-Type': 'foo' }, 'bar');
|
||||
@@ -107,6 +107,7 @@ function testXHR() {
|
||||
sinon.FakeXMLHttpRequest.useFilters = true;
|
||||
sinon.FakeXMLHttpRequest.addFilter((method, url, async, user, pass) => true);
|
||||
sinon.FakeXMLHttpRequest.onCreate = (xhr) => {};
|
||||
sinon.FakeXMLHttpRequest.restore();
|
||||
}
|
||||
|
||||
function testClock() {
|
||||
|
||||
Reference in New Issue
Block a user