mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-18 15:33:12 +09:00
Setup logging transport in tests
Without a transport Winston will print annoying "Attempt to write logs with no transports" warnings all over the place. Setup a transport in tests that cause logging to suppress this.
This commit is contained in:
1 parent
2c52c265cf
commit
ea1cb67502
20 files changed
+42
-9
No files matched your search
@@ -9,6 +9,7 @@ const nativeFetch = global.fetch;
|
||||
|
||||
import { ModStore, ModInfo, ModVersionEquality } from "@clusterio/lib"; // Adjust path based on compiled output
|
||||
import { externalTest } from "../integration/index.js";
|
||||
import "../setup_logging.js";
|
||||
|
||||
const MODS_DIR = path.join("temp", "test", "mod_store", "mods");
|
||||
const CACHE_FILE = path.join(MODS_DIR, "mod-info-cache.json");
|
||||
|
||||
Vendored
+2
@@ -4,6 +4,8 @@ import path from "node:path";
|
||||
|
||||
import * as lib from "@clusterio/lib";
|
||||
|
||||
import "../setup_logging.js";
|
||||
|
||||
describe("lib/bootstrap", function() {
|
||||
describe("loadConfigFromArgs()", function() {
|
||||
const folder = path.join("temp", "test", "bootstrap");
|
||||
|
||||
@@ -3,6 +3,7 @@ import assert from "node:assert/strict";
|
||||
import * as lib from "@clusterio/lib";
|
||||
import fs from "node:fs/promises";
|
||||
import path from "node:path";
|
||||
import "../setup_logging.js";
|
||||
|
||||
class MockDatastoreProvider extends lib.DatastoreProvider {
|
||||
constructor() {
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
import assert from "node:assert/strict";
|
||||
import events from "node:events";
|
||||
|
||||
import * as mock from "../../mock.js";
|
||||
import * as lib from "@clusterio/lib";
|
||||
import * as mock from "../../mock.js";
|
||||
import "../../setup_logging.js";
|
||||
|
||||
|
||||
describe("lib/link/connectors", function() {
|
||||
|
||||
@@ -3,6 +3,7 @@ import events from "node:events";
|
||||
|
||||
import * as lib from "@clusterio/lib";
|
||||
import * as mock from "../../mock.js";
|
||||
import "../../setup_logging.js";
|
||||
|
||||
const addr = lib.Address.fromShorthand;
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import path from "node:path";
|
||||
|
||||
import { testLines } from "./factorio/lines.js";
|
||||
import * as lib from "@clusterio/lib";
|
||||
import "../setup_logging.js";
|
||||
|
||||
|
||||
describe("lib/logging_utils.js", function() {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import assert from "node:assert/strict";
|
||||
import * as lib from "@clusterio/lib";
|
||||
import "../setup_logging.js";
|
||||
|
||||
describe("rce_ops", function() {
|
||||
describe("updatePackage", function() {
|
||||
|
||||
@@ -4,6 +4,7 @@ import path from "node:path";
|
||||
|
||||
import * as lib from "@clusterio/lib";
|
||||
import { slowTest } from "../integration/index.js";
|
||||
import "../setup_logging.js";
|
||||
|
||||
|
||||
describe("lib/shared_commands", function() {
|
||||
|
||||
@@ -3,6 +3,7 @@ import assert from "node:assert/strict";
|
||||
import * as lib from "@clusterio/lib";
|
||||
import { MockController, MockConnector, MockControl } from "../mock.js";
|
||||
import { testMatrix, testRoundTripJsonSerialisable } from "../common.js";
|
||||
import "../setup_logging.js";
|
||||
|
||||
const addr = lib.Address.fromShorthand;
|
||||
|
||||
|
||||
Reference in new issue
Block a user