fix test: use fetchMock to avoid test interference

This commit is contained in:
Valere
2026-03-31 11:55:49 +02:00
parent 6b7467ce6d
commit 8cee4df46e

View File

@@ -21,7 +21,6 @@ import {
} from "matrix-js-sdk/lib/matrixrtc";
import { BehaviorSubject, lastValueFrom } from "rxjs";
import fetchMock from "fetch-mock";
import { AutoDiscovery } from "matrix-js-sdk/lib/autodiscovery";
import {
mockConfig,
@@ -424,21 +423,14 @@ describe("LocalTransport", () => {
localTransportOpts.client.getDomain.mockReturnValue("example.org");
vi.spyOn(AutoDiscovery, "getRawClientConfig").mockImplementation(
async (domain) => {
if (domain === "example.org") {
return Promise.resolve({
"org.matrix.msc4143.rtc_foci": [
{
type: "livekit",
livekit_service_url: "https://use-me.jwt.call.example.org",
},
],
});
}
return Promise.resolve({});
},
);
fetchMock.getOnce("https://example.org/.well-known/matrix/client", {
"org.matrix.msc4143.rtc_foci": [
{
type: "livekit",
livekit_service_url: "https://use-me.jwt.call.example.org",
},
],
});
localTransportOpts.client.getAccessToken.mockReturnValue(null);
const { advertised$, active$ } =