You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-07-31 15:24:23 +03:00
Fix broken tests
This commit is contained in:
@ -18,7 +18,7 @@ limitations under the License.
|
|||||||
import { MatrixClient } from "../../src/client";
|
import { MatrixClient } from "../../src/client";
|
||||||
import { logger } from "../../src/logger";
|
import { logger } from "../../src/logger";
|
||||||
import { InteractiveAuth, AuthType } from "../../src/interactive-auth";
|
import { InteractiveAuth, AuthType } from "../../src/interactive-auth";
|
||||||
import { MatrixError } from "../../src/http-api";
|
import { HTTPError, MatrixError } from "../../src/http-api";
|
||||||
import { sleep } from "../../src/utils";
|
import { sleep } from "../../src/utils";
|
||||||
import { randomString } from "../../src/randomstring";
|
import { randomString } from "../../src/randomstring";
|
||||||
|
|
||||||
@ -219,8 +219,7 @@ describe("InteractiveAuth", () => {
|
|||||||
params: {
|
params: {
|
||||||
[AuthType.Password]: { param: "aa" },
|
[AuthType.Password]: { param: "aa" },
|
||||||
},
|
},
|
||||||
});
|
}, 401);
|
||||||
err.httpStatus = 401;
|
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -282,8 +281,7 @@ describe("InteractiveAuth", () => {
|
|||||||
params: {
|
params: {
|
||||||
[AuthType.Password]: { param: "aa" },
|
[AuthType.Password]: { param: "aa" },
|
||||||
},
|
},
|
||||||
});
|
}, 401);
|
||||||
err.httpStatus = 401;
|
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -338,8 +336,7 @@ describe("InteractiveAuth", () => {
|
|||||||
params: {
|
params: {
|
||||||
[AuthType.Password]: { param: "aa" },
|
[AuthType.Password]: { param: "aa" },
|
||||||
},
|
},
|
||||||
});
|
}, 401);
|
||||||
err.httpStatus = 401;
|
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -374,8 +371,7 @@ describe("InteractiveAuth", () => {
|
|||||||
},
|
},
|
||||||
error: "Mock Error 1",
|
error: "Mock Error 1",
|
||||||
errcode: "MOCKERR1",
|
errcode: "MOCKERR1",
|
||||||
});
|
}, 401);
|
||||||
err.httpStatus = 401;
|
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -402,8 +398,7 @@ describe("InteractiveAuth", () => {
|
|||||||
doRequest.mockImplementation((authData) => {
|
doRequest.mockImplementation((authData) => {
|
||||||
logger.log("request1", authData);
|
logger.log("request1", authData);
|
||||||
expect(authData).toEqual({ "session": "sessionId" }); // has existing sessionId
|
expect(authData).toEqual({ "session": "sessionId" }); // has existing sessionId
|
||||||
const err = new Error('myerror');
|
const err = new HTTPError('myerror', 401);
|
||||||
(err as any).httpStatus = 401;
|
|
||||||
throw err;
|
throw err;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user