1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-09 10:22:46 +03:00

Tests: gate logging behind DEBUG env var (#4903)

* Add `DebugLogger` type for logging matrix-js-sdk to `debug`

* unit tests for DebugLogger

* Use `DebugLogger` in some tests

* Use `DebugLogger` in rust-crypto.spec

* test-utils: silence some logging
This commit is contained in:
Richard van der Hoff
2025-07-10 07:15:00 +01:00
committed by GitHub
parent 090b8079db
commit be15a709c6
9 changed files with 157 additions and 25 deletions

View File

@@ -17,6 +17,7 @@ limitations under the License.
import "fake-indexeddb/auto";
import anotherjson from "another-json";
import debug from "debug";
import fetchMock from "fetch-mock-jest";
import { IDBFactory } from "fake-indexeddb";
import { createHash } from "crypto";
@@ -25,6 +26,7 @@ import Olm from "@matrix-org/olm";
import type FetchMock from "fetch-mock";
import {
createClient,
DebugLogger,
DeviceVerification,
type IContent,
type ICreateClientOpts,
@@ -1475,6 +1477,7 @@ describe("verification", () => {
userId: TEST_USER_ID,
accessToken: "akjgkrgjs",
deviceId: "device_under_test",
logger: new DebugLogger(debug(`matrix-js-sdk:verification`)),
...opts,
});
await client.initRustCrypto();