diff --git a/packages/zwave-js/src/Testing.ts b/packages/zwave-js/src/Testing.ts index cdbd8d65f23..0e259be36f5 100644 --- a/packages/zwave-js/src/Testing.ts +++ b/packages/zwave-js/src/Testing.ts @@ -1,4 +1,6 @@ +export { createDefaultBehaviors as createDefaultMockControllerBehaviors } from "./lib/controller/MockControllerBehaviors.js"; export { createAndStartDriverWithMockPort } from "./lib/driver/DriverMock.js"; +export { createDefaultBehaviors as createDefaultMockNodeBehaviors } from "./lib/node/MockNodeBehaviors.js"; export { MockServer, createMockNodeOptionsFromDump } from "./mockServer.js"; export type { MockServerControllerOptions, diff --git a/packages/zwave-js/src/Utils.ts b/packages/zwave-js/src/Utils.ts index 23803c2a7f1..6e252d7b789 100644 --- a/packages/zwave-js/src/Utils.ts +++ b/packages/zwave-js/src/Utils.ts @@ -24,7 +24,6 @@ export { getEnumMemberName, num2hex, } from "@zwave-js/shared/safe"; -export { createDefaultBehaviors as createDefaultMockControllerBehaviors } from "./lib/controller/MockControllerBehaviors.js"; export { driverPresets } from "./lib/driver/ZWaveOptions.js"; export { formatLifelineHealthCheckRound, @@ -33,4 +32,3 @@ export { formatRouteHealthCheckSummary, healthCheckRatingToWord, } from "./lib/node/HealthCheck.js"; -export { createDefaultBehaviors as createDefaultMockNodeBehaviors } from "./lib/node/MockNodeBehaviors.js"; diff --git a/packages/zwave-js/src/lib/controller/Controller.nodes.getOrThrow.test.ts b/packages/zwave-js/src/lib/controller/Controller.nodes.getOrThrow.test.ts index e00599bce6d..f864722a1a6 100644 --- a/packages/zwave-js/src/lib/controller/Controller.nodes.getOrThrow.test.ts +++ b/packages/zwave-js/src/lib/controller/Controller.nodes.getOrThrow.test.ts @@ -2,7 +2,7 @@ import { ZWaveErrorCodes, assertZWaveError } from "@zwave-js/core"; import type { ThrowingMap } from "@zwave-js/shared"; import { MockController } from "@zwave-js/testing"; import { test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../Testing.js"; import type { Driver } from "../driver/Driver.js"; import { createAndStartTestingDriver } from "../driver/DriverMock.js"; import { ZWaveNode } from "../node/Node.js"; diff --git a/packages/zwave-js/src/lib/node/Endpoint.test.ts b/packages/zwave-js/src/lib/node/Endpoint.test.ts index abb41b83391..9cc87d04e79 100644 --- a/packages/zwave-js/src/lib/node/Endpoint.test.ts +++ b/packages/zwave-js/src/lib/node/Endpoint.test.ts @@ -8,7 +8,7 @@ import { } from "@zwave-js/core"; import { MockController } from "@zwave-js/testing"; import { afterEach, test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../Testing.js"; import type { Driver } from "../driver/Driver.js"; import { createAndStartTestingDriver } from "../driver/DriverMock.js"; import { Endpoint } from "./Endpoint.js"; diff --git a/packages/zwave-js/src/lib/node/VirtualEndpoint.test.ts b/packages/zwave-js/src/lib/node/VirtualEndpoint.test.ts index dc9c1fae957..214b8526ee8 100644 --- a/packages/zwave-js/src/lib/node/VirtualEndpoint.test.ts +++ b/packages/zwave-js/src/lib/node/VirtualEndpoint.test.ts @@ -25,7 +25,7 @@ import { test as baseTest } from "vitest"; import { createDefaultMockControllerBehaviors, createDefaultMockNodeBehaviors, -} from "../../Utils.js"; +} from "../../Testing.js"; import type { Driver } from "../driver/Driver.js"; import { createAndStartTestingDriver } from "../driver/DriverMock.js"; import { ZWaveNode } from "./Node.js"; diff --git a/packages/zwave-js/src/lib/test/cc/API.test.ts b/packages/zwave-js/src/lib/test/cc/API.test.ts index 7f8c5f4f146..f1ec103ee63 100644 --- a/packages/zwave-js/src/lib/test/cc/API.test.ts +++ b/packages/zwave-js/src/lib/test/cc/API.test.ts @@ -3,7 +3,7 @@ import { NOT_KNOWN } from "@zwave-js/core"; import type { ThrowingMap } from "@zwave-js/shared"; import { MockController } from "@zwave-js/testing"; import { test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { ZWaveNode } from "../../node/Node.js"; diff --git a/packages/zwave-js/src/lib/test/cc/CommandClass.persistValues.test.ts b/packages/zwave-js/src/lib/test/cc/CommandClass.persistValues.test.ts index 7d480168bcf..d723c8f59c2 100644 --- a/packages/zwave-js/src/lib/test/cc/CommandClass.persistValues.test.ts +++ b/packages/zwave-js/src/lib/test/cc/CommandClass.persistValues.test.ts @@ -6,7 +6,7 @@ import type { ThrowingMap } from "@zwave-js/shared"; import { MockController } from "@zwave-js/testing"; import sinon from "sinon"; import { afterEach, beforeEach, test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { ZWaveNode } from "../../node/Node.js"; diff --git a/packages/zwave-js/src/lib/test/driver/assemblePartialCCs.test.ts b/packages/zwave-js/src/lib/test/driver/assemblePartialCCs.test.ts index 31a3db51005..e0a895f4ae5 100644 --- a/packages/zwave-js/src/lib/test/driver/assemblePartialCCs.test.ts +++ b/packages/zwave-js/src/lib/test/driver/assemblePartialCCs.test.ts @@ -8,7 +8,7 @@ import { CommandClasses, ZWaveError, ZWaveErrorCodes } from "@zwave-js/core"; import { ApplicationCommandRequest } from "@zwave-js/serial/serialapi"; import { MockController, MockNode } from "@zwave-js/testing"; import { test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; diff --git a/packages/zwave-js/src/lib/test/driver/computeNetCCPayloadSize.test.ts b/packages/zwave-js/src/lib/test/driver/computeNetCCPayloadSize.test.ts index 2ed04bc0ab5..3346a3c0eee 100644 --- a/packages/zwave-js/src/lib/test/driver/computeNetCCPayloadSize.test.ts +++ b/packages/zwave-js/src/lib/test/driver/computeNetCCPayloadSize.test.ts @@ -5,7 +5,7 @@ import { EncapsulationFlags, TransmitOptions } from "@zwave-js/core"; import { SendDataRequest } from "@zwave-js/serial/serialapi"; import { MockController } from "@zwave-js/testing"; import { test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; diff --git a/packages/zwave-js/src/lib/test/driver/hasPendingMessages.test.ts b/packages/zwave-js/src/lib/test/driver/hasPendingMessages.test.ts index 0aabc8b5e00..e69e52262c3 100644 --- a/packages/zwave-js/src/lib/test/driver/hasPendingMessages.test.ts +++ b/packages/zwave-js/src/lib/test/driver/hasPendingMessages.test.ts @@ -1,7 +1,7 @@ import { CommandClasses, type ValueID } from "@zwave-js/core"; import { MockController } from "@zwave-js/testing"; import { test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { ZWaveNode } from "../../node/Node.js"; diff --git a/packages/zwave-js/src/lib/test/integrationTestSuiteShared.ts b/packages/zwave-js/src/lib/test/integrationTestSuiteShared.ts index be056da0422..e9f679567a5 100644 --- a/packages/zwave-js/src/lib/test/integrationTestSuiteShared.ts +++ b/packages/zwave-js/src/lib/test/integrationTestSuiteShared.ts @@ -12,7 +12,7 @@ import { fileURLToPath } from "node:url"; import { createDefaultMockControllerBehaviors, createDefaultMockNodeBehaviors, -} from "../../Utils.js"; +} from "../../Testing.js"; import { type CreateAndStartDriverWithMockPortResult, createAndStartDriverWithMockPort, diff --git a/packages/zwave-js/src/lib/test/node/Node.ccVersions.test.ts b/packages/zwave-js/src/lib/test/node/Node.ccVersions.test.ts index 3de80e476d6..b342c4542e1 100644 --- a/packages/zwave-js/src/lib/test/node/Node.ccVersions.test.ts +++ b/packages/zwave-js/src/lib/test/node/Node.ccVersions.test.ts @@ -1,7 +1,7 @@ import { CommandClasses } from "@zwave-js/core"; import { MockController } from "@zwave-js/testing"; import { test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { ZWaveNode } from "../../node/Node.js"; diff --git a/packages/zwave-js/src/lib/test/node/Node.constructor.test.ts b/packages/zwave-js/src/lib/test/node/Node.constructor.test.ts index 107aba8e94a..b93b84bf48e 100644 --- a/packages/zwave-js/src/lib/test/node/Node.constructor.test.ts +++ b/packages/zwave-js/src/lib/test/node/Node.constructor.test.ts @@ -4,7 +4,7 @@ import "@zwave-js/cc"; import { CommandClasses, ValueDB } from "@zwave-js/core"; import { MockController } from "@zwave-js/testing"; import { afterEach, test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { DeviceClass } from "../../node/DeviceClass.js"; diff --git a/packages/zwave-js/src/lib/test/node/Node.createCCInstance.test.ts b/packages/zwave-js/src/lib/test/node/Node.createCCInstance.test.ts index e9eacf4edcc..a9d1812e43d 100644 --- a/packages/zwave-js/src/lib/test/node/Node.createCCInstance.test.ts +++ b/packages/zwave-js/src/lib/test/node/Node.createCCInstance.test.ts @@ -7,7 +7,7 @@ import { import type { ThrowingMap } from "@zwave-js/shared"; import { MockController } from "@zwave-js/testing"; import { test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { ZWaveNode } from "../../node/Node.js"; diff --git a/packages/zwave-js/src/lib/test/node/Node.getEndpoint.test.ts b/packages/zwave-js/src/lib/test/node/Node.getEndpoint.test.ts index c75006241c8..34aa1bfb449 100644 --- a/packages/zwave-js/src/lib/test/node/Node.getEndpoint.test.ts +++ b/packages/zwave-js/src/lib/test/node/Node.getEndpoint.test.ts @@ -6,7 +6,7 @@ import { import type { ThrowingMap } from "@zwave-js/shared"; import { MockController } from "@zwave-js/testing"; import { afterEach, beforeEach, test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { DeviceClass } from "../../node/DeviceClass.js"; diff --git a/packages/zwave-js/src/lib/test/node/Node.getSetValue.test.ts b/packages/zwave-js/src/lib/test/node/Node.getSetValue.test.ts index 0bec8b59c77..6a5b80f298c 100644 --- a/packages/zwave-js/src/lib/test/node/Node.getSetValue.test.ts +++ b/packages/zwave-js/src/lib/test/node/Node.getSetValue.test.ts @@ -5,7 +5,7 @@ import type { ThrowingMap } from "@zwave-js/shared"; import { MockController } from "@zwave-js/testing"; import sinon from "sinon"; import { type TaskContext, test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { ZWaveNode } from "../../node/Node.js"; diff --git a/packages/zwave-js/src/lib/test/node/Node.status.test.ts b/packages/zwave-js/src/lib/test/node/Node.status.test.ts index c2d29f3fe47..d78f14be5dc 100644 --- a/packages/zwave-js/src/lib/test/node/Node.status.test.ts +++ b/packages/zwave-js/src/lib/test/node/Node.status.test.ts @@ -2,7 +2,7 @@ import { NodeStatus } from "@zwave-js/core"; import { MockController } from "@zwave-js/testing"; import sinon from "sinon"; import { test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { ZWaveNode } from "../../node/Node.js"; diff --git a/packages/zwave-js/src/lib/test/node/Node.updateNodeInfo.test.ts b/packages/zwave-js/src/lib/test/node/Node.updateNodeInfo.test.ts index f5d38df33d8..1e198a99992 100644 --- a/packages/zwave-js/src/lib/test/node/Node.updateNodeInfo.test.ts +++ b/packages/zwave-js/src/lib/test/node/Node.updateNodeInfo.test.ts @@ -5,7 +5,7 @@ import { CommandClasses, InterviewStage, NodeStatus } from "@zwave-js/core"; import type { ThrowingMap } from "@zwave-js/shared"; import { MockController } from "@zwave-js/testing"; import { afterEach, test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { ZWaveNode } from "../../node/Node.js"; diff --git a/packages/zwave-js/src/lib/test/node/Node.valueEvents.test.ts b/packages/zwave-js/src/lib/test/node/Node.valueEvents.test.ts index 674855a3430..e46afd3c416 100644 --- a/packages/zwave-js/src/lib/test/node/Node.valueEvents.test.ts +++ b/packages/zwave-js/src/lib/test/node/Node.valueEvents.test.ts @@ -3,7 +3,7 @@ import type { ThrowingMap } from "@zwave-js/shared"; import { MockController } from "@zwave-js/testing"; import sinon from "sinon"; import { afterEach, beforeEach, test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { ZWaveNode } from "../../node/Node.js"; diff --git a/packages/zwave-js/src/lib/test/node/Node.waitForWakeup.test.ts b/packages/zwave-js/src/lib/test/node/Node.waitForWakeup.test.ts index ae8ba10ee0f..530870daa38 100644 --- a/packages/zwave-js/src/lib/test/node/Node.waitForWakeup.test.ts +++ b/packages/zwave-js/src/lib/test/node/Node.waitForWakeup.test.ts @@ -7,7 +7,7 @@ import type { ThrowingMap } from "@zwave-js/shared"; import { MockController } from "@zwave-js/testing"; import { wait } from "alcalzone-shared/async"; import { test as baseTest } from "vitest"; -import { createDefaultMockControllerBehaviors } from "../../../Utils.js"; +import { createDefaultMockControllerBehaviors } from "../../../Testing.js"; import type { Driver } from "../../driver/Driver.js"; import { createAndStartTestingDriver } from "../../driver/DriverMock.js"; import { ZWaveNode } from "../../node/Node.js"; diff --git a/packages/zwave-js/src/mockServer.ts b/packages/zwave-js/src/mockServer.ts index 09e5e359453..0d410985efe 100644 --- a/packages/zwave-js/src/mockServer.ts +++ b/packages/zwave-js/src/mockServer.ts @@ -48,10 +48,10 @@ import { import { createDeferredPromise } from "alcalzone-shared/deferred-promise"; import { type AddressInfo, type Server, createServer } from "node:net"; import { - ProtocolVersion, createDefaultMockControllerBehaviors, createDefaultMockNodeBehaviors, -} from "./Utils.js"; +} from "./Testing.js"; +import { ProtocolVersion } from "./Utils.js"; import { type CommandClassDump, type NodeDump } from "./lib/node/Dump.js"; export type MockServerControllerOptions =