diff --git a/packages/config/src/ConfigManager.test.ts b/packages/config/src/ConfigManager.test.ts index 01305cca3bf..c646d5fed28 100644 --- a/packages/config/src/ConfigManager.test.ts +++ b/packages/config/src/ConfigManager.test.ts @@ -1,5 +1,6 @@ -import { ZWaveLogContainer } from "@zwave-js/core"; +import { type LogContainer } from "@zwave-js/core"; import { fs } from "@zwave-js/core/bindings/fs/node"; +import { log as createZWaveLogContainer } from "@zwave-js/core/bindings/log/node"; import { pathExists } from "@zwave-js/shared"; import fsp from "node:fs/promises"; import { tmpdir } from "node:os"; @@ -13,7 +14,7 @@ import { syncExternalConfigDir } from "./utils.js"; interface LocalTestContext { context: { tempDir: string; - logContainer: ZWaveLogContainer; + logContainer: LogContainer; logger: ConfigLogger; }; } @@ -28,7 +29,7 @@ const test = baseTest.extend({ const tempDir = path.join(tmpdir(), "zwavejs_test"); await fsp.mkdir(tempDir, { recursive: true }); - const logContainer = new ZWaveLogContainer({ enabled: false }); + const logContainer = createZWaveLogContainer({ enabled: false }); const logger = new ConfigLogger(logContainer); // Run tests @@ -213,7 +214,7 @@ async function testDeviceConfigPriorityDir( // And load the file const cm = new ConfigManager({ deviceConfigPriorityDir: priorityDir, - logContainer: new ZWaveLogContainer({ enabled: false }), + logContainer: createZWaveLogContainer({ enabled: false }), }); await cm.loadAll(); diff --git a/packages/core/src/log/Controller.test.ts b/packages/core/src/log/Controller.test.ts index 538b2e86393..3230b98fa34 100644 --- a/packages/core/src/log/Controller.test.ts +++ b/packages/core/src/log/Controller.test.ts @@ -1,3 +1,4 @@ +import { log as createZWaveLogContainer } from "@zwave-js/core/bindings/log/node"; import { beforeEach, test as baseTest } from "vitest"; import { CommandClasses } from "../definitions/CommandClasses.js"; import { InterviewStage } from "../definitions/InterviewStage.js"; @@ -7,7 +8,7 @@ import { assertMessage, } from "../test/SpyTransport.js"; import { ControllerLogger } from "./Controller.js"; -import { ZWaveLogContainer, createDefaultTransportFormat } from "./shared.js"; +import { createDefaultTransportFormat } from "./shared.js"; // Extend the test conte @@ -25,7 +26,7 @@ const test = baseTest.extend({ const spyTransport = new SpyTransport(); spyTransport.format = createDefaultTransportFormat(true, true); const controllerLogger = new ControllerLogger( - new ZWaveLogContainer({ + createZWaveLogContainer({ transports: [spyTransport], }), ); diff --git a/packages/serial/src/serialport/ZWaveSerialStream.test.ts b/packages/serial/src/serialport/ZWaveSerialStream.test.ts index 3f18e4c5b07..85fd2ef2841 100644 --- a/packages/serial/src/serialport/ZWaveSerialStream.test.ts +++ b/packages/serial/src/serialport/ZWaveSerialStream.test.ts @@ -1,4 +1,4 @@ -import { ZWaveLogContainer } from "@zwave-js/core"; +import { log as createZWaveLogContainer } from "@zwave-js/core/bindings/log/node"; import { Bytes } from "@zwave-js/shared"; import { isUint8Array } from "node:util/types"; import { @@ -35,7 +35,7 @@ const test = baseTest.extend({ context.port = port; context.factory = new ZWaveSerialStreamFactory( port.factory(), - new ZWaveLogContainer({ enabled: false }), + createZWaveLogContainer({ enabled: false }), ); // Run tests diff --git a/packages/zwave-js/src/lib/log/Driver.test.ts b/packages/zwave-js/src/lib/log/Driver.test.ts index b77d12fe98e..fce9c982b90 100644 --- a/packages/zwave-js/src/lib/log/Driver.test.ts +++ b/packages/zwave-js/src/lib/log/Driver.test.ts @@ -1,9 +1,9 @@ import { MessagePriority, - ZWaveLogContainer, createDefaultTransportFormat, getDirectionPrefix, } from "@zwave-js/core"; +import { log as createZWaveLogContainer } from "@zwave-js/core/bindings/log/node"; import { SpyTransport, assertLogInfo, @@ -43,7 +43,7 @@ const test = baseTest.extend({ spyTransport.format = createDefaultTransportFormat(true, true); const driverLogger = new DriverLogger( driver, - new ZWaveLogContainer({ + createZWaveLogContainer({ transports: [spyTransport], }), ); diff --git a/packages/zwave-js/src/lib/test/driver/SerialLogger.test.ts b/packages/zwave-js/src/lib/test/driver/SerialLogger.test.ts index 3151423e8e6..54e91ede7b0 100644 --- a/packages/zwave-js/src/lib/test/driver/SerialLogger.test.ts +++ b/packages/zwave-js/src/lib/test/driver/SerialLogger.test.ts @@ -1,7 +1,5 @@ -import { - ZWaveLogContainer, - createDefaultTransportFormat, -} from "@zwave-js/core"; +import { createDefaultTransportFormat } from "@zwave-js/core"; +import { log as createZWaveLogContainer } from "@zwave-js/core/bindings/log/node"; import { SpyTransport, assertMessage } from "@zwave-js/core/test"; import { SerialLogger } from "@zwave-js/serial"; import { Bytes } from "@zwave-js/shared/safe"; @@ -24,7 +22,7 @@ const test = baseTest.extend({ const spyTransport = new SpyTransport(); spyTransport.format = createDefaultTransportFormat(true, true); const serialLogger = new SerialLogger( - new ZWaveLogContainer({ + createZWaveLogContainer({ transports: [spyTransport], }), );