Skip to content

Commit bec5765

Browse files
refactor: server part expects special syntax in some cases
--> revert
1 parent 7fe2a08 commit bec5765

1 file changed

Lines changed: 2 additions & 36 deletions

File tree

packages/binding-opcua/test/client-test.ts

Lines changed: 2 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ describe("OPCUA Client", function () {
139139
});
140140
});
141141

142-
it("Y2a - should subscribe to a topic", async () => {
142+
it("Y2 - should subscribe to a topic", async () => {
143143
const form: OPCUAForm = {
144144
href: endpoint,
145145
"opcua:nodeId": VariableIds.Server_ServerStatus_CurrentTime,
@@ -154,22 +154,8 @@ describe("OPCUA Client", function () {
154154
}
155155
});
156156
});
157-
it("Y2b - should subscribe to a topic", async () => {
158-
const form: OPCUAForm = {
159-
href: endpoint + "?id=" + VariableIds.Server_ServerStatus_CurrentTime,
160-
};
161157

162-
let counter = 0;
163-
const sub = await client.subscribeResource(form, async () => {
164-
counter++;
165-
if (counter > 3) {
166-
// await client.unlinkResource(form);
167-
sub.unsubscribe();
168-
}
169-
});
170-
});
171-
172-
it("Y3a - should subscribe to many topics but establish the opcua connection once", async () => {
158+
it("Y3 - should subscribe to many topics but establish the opcua connection once", async () => {
173159
const form: OPCUAForm = {
174160
href: endpoint,
175161
"opcua:nodeId": VariableIds.Server_ServerStatus_CurrentTime,
@@ -190,26 +176,6 @@ describe("OPCUA Client", function () {
190176
client.subscribeResource(form, onSubscribedValueChanged);
191177
});
192178
});
193-
it("Y3b - should subscribe to many topics but establish the opcua connection once", async () => {
194-
const form: OPCUAForm = {
195-
href: endpoint + "?id=" + VariableIds.Server_ServerStatus_CurrentTime,
196-
};
197-
198-
await new Promise<void>((resolve) => {
199-
let counter = 0;
200-
const onSubscribedValueChanged = async () => {
201-
counter++;
202-
if (counter > 3) {
203-
await client.unlinkResource(form);
204-
resolve();
205-
}
206-
};
207-
client.subscribeResource(form, onSubscribedValueChanged);
208-
client.subscribeResource(form, onSubscribedValueChanged);
209-
client.subscribeResource(form, onSubscribedValueChanged);
210-
client.subscribeResource(form, onSubscribedValueChanged);
211-
});
212-
});
213179

214180
it("Y4 - invokeResource", async () => {
215181
const inputSchema = {

0 commit comments

Comments
 (0)