Quellcode durchsuchen

refactor: exclude all logs to console by default when running tests

Kristian Vos vor 8 Monaten
Ursprung
Commit
1f23fd7794
1 geänderte Dateien mit 22 neuen und 4 gelöschten Zeilen
  1. 22 4
      backend/src/tests/support/setup.ts

+ 22 - 4
backend/src/tests/support/setup.ts

@@ -1,12 +1,30 @@
 import chai from "chai";
 import chaiAsPromised from "chai-as-promised";
-import sinon from "sinon";
 import sinonChai from "sinon-chai";
+import LogBook from "@/LogBook";
 
 chai.should();
 chai.use(sinonChai);
 chai.use(chaiAsPromised);
 
-afterEach(async function () {
-	sinon.reset();
-});
+if (typeof beforeEach !== "undefined")
+	beforeEach(async function () {
+		await LogBook.updateOutput("console", "exclude", "set", [
+			{
+				// @ts-ignore
+				type: "error"
+			},
+			{
+				// @ts-ignore
+				type: "debug"
+			},
+			{
+				// @ts-ignore
+				type: "info"
+			},
+			{
+				// @ts-ignore
+				type: "success"
+			}
+		]);
+	});