@matterbridge/vitest-utils 3.9.0-dev-20260612-80cb9b0 → 3.9.0-dev-20260612-1840a85
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -10,6 +10,10 @@ export declare let aggregator: Endpoint<AggregatorEndpoint>;
|
|
|
10
10
|
export declare function createTestEnvironment(): Promise<Environment>;
|
|
11
11
|
export declare function destroyTestEnvironment(): Promise<void>;
|
|
12
12
|
export declare function getMatterbridge(): PlatformMatterbridge;
|
|
13
|
+
export declare const addBridgedEndpoint: import("vitest").Mock<(pluginName: string, device: Endpoint) => Promise<boolean>>;
|
|
14
|
+
export declare const removeBridgedEndpoint: import("vitest").Mock<(pluginName: string, device: Endpoint) => Promise<boolean>>;
|
|
15
|
+
export declare const removeAllBridgedEndpoints: import("vitest").Mock<(pluginName: string, _delay?: number) => Promise<boolean>>;
|
|
16
|
+
export declare const addVirtualEndpoint: import("vitest").Mock<(pluginName: string, name: string, type: "light" | "outlet" | "switch" | "mounted_switch", callback: () => Promise<void>) => Promise<boolean>>;
|
|
13
17
|
export declare const addBridgedEndpointMatterbridgeSpy: import("vitest").Mock<(pluginName: string, device: Endpoint) => Promise<boolean>>;
|
|
14
18
|
export declare const removeBridgedEndpointMatterbridgeSpy: import("vitest").Mock<(pluginName: string, device: Endpoint) => Promise<boolean>>;
|
|
15
19
|
export declare const removeAllBridgedEndpointsMatterbridgeSpy: import("vitest").Mock<(pluginName: string, _delay?: number) => Promise<boolean>>;
|
package/dist/vitestMatterTest.js
CHANGED
|
@@ -75,7 +75,7 @@ export function getMatterbridge() {
|
|
|
75
75
|
};
|
|
76
76
|
return matterbridge;
|
|
77
77
|
}
|
|
78
|
-
const addBridgedEndpoint = vi.fn(async (pluginName, device) => {
|
|
78
|
+
export const addBridgedEndpoint = vi.fn(async (pluginName, device) => {
|
|
79
79
|
try {
|
|
80
80
|
await aggregator.add(device);
|
|
81
81
|
return Promise.resolve(true);
|
|
@@ -84,7 +84,7 @@ const addBridgedEndpoint = vi.fn(async (pluginName, device) => {
|
|
|
84
84
|
return Promise.reject(error);
|
|
85
85
|
}
|
|
86
86
|
});
|
|
87
|
-
const removeBridgedEndpoint = vi.fn(async (pluginName, device) => {
|
|
87
|
+
export const removeBridgedEndpoint = vi.fn(async (pluginName, device) => {
|
|
88
88
|
try {
|
|
89
89
|
await device.delete();
|
|
90
90
|
return Promise.resolve(true);
|
|
@@ -93,7 +93,7 @@ const removeBridgedEndpoint = vi.fn(async (pluginName, device) => {
|
|
|
93
93
|
return Promise.reject(error);
|
|
94
94
|
}
|
|
95
95
|
});
|
|
96
|
-
const removeAllBridgedEndpoints = vi.fn(async (pluginName, _delay = 0) => {
|
|
96
|
+
export const removeAllBridgedEndpoints = vi.fn(async (pluginName, _delay = 0) => {
|
|
97
97
|
try {
|
|
98
98
|
for (const device of aggregator.parts) {
|
|
99
99
|
await device.delete();
|
|
@@ -104,7 +104,7 @@ const removeAllBridgedEndpoints = vi.fn(async (pluginName, _delay = 0) => {
|
|
|
104
104
|
return Promise.reject(error);
|
|
105
105
|
}
|
|
106
106
|
});
|
|
107
|
-
const addVirtualEndpoint = vi.fn(async (pluginName, name, type, callback) => {
|
|
107
|
+
export const addVirtualEndpoint = vi.fn(async (pluginName, name, type, callback) => {
|
|
108
108
|
try {
|
|
109
109
|
const device = new Endpoint(MountedOnOffControlDevice.with(BridgedDeviceBasicInformationServer), {
|
|
110
110
|
id: name.replaceAll(' ', '') + ':' + type,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@matterbridge/vitest-utils",
|
|
3
|
-
"version": "3.9.0-dev-20260612-
|
|
3
|
+
"version": "3.9.0-dev-20260612-1840a85",
|
|
4
4
|
"description": "Matterbridge vitest utility library",
|
|
5
5
|
"author": "https://github.com/Luligu",
|
|
6
6
|
"homepage": "https://matterbridge.io/",
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
"CHANGELOG.md"
|
|
66
66
|
],
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@matterbridge/types": "3.9.0-dev-20260612-
|
|
68
|
+
"@matterbridge/types": "3.9.0-dev-20260612-1840a85",
|
|
69
69
|
"node-ansi-logger": "3.3.0-dev-20260607-585945a"
|
|
70
70
|
}
|
|
71
71
|
}
|