From 2e6fc0951dfea2c4b316dd8c735a46fdf5effb4c Mon Sep 17 00:00:00 2001 From: danielpeintner Date: Fri, 13 Oct 2023 15:19:51 +0200 Subject: [PATCH] chore(binding-opcua): improve/stabilize tests (#1120) * chore(binding-opcua): improve/stabilize tests see https://github.com/eclipse-thingweb/node-wot/pull/1072 * fix typo Co-authored-by: Jan Romann --------- Co-authored-by: Jan Romann --- packages/binding-opcua/test/client-test.ts | 7 ++++--- packages/binding-opcua/test/full-opcua-thing-test.ts | 4 ++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/packages/binding-opcua/test/client-test.ts b/packages/binding-opcua/test/client-test.ts index 415a8dc60..30f0b0327 100644 --- a/packages/binding-opcua/test/client-test.ts +++ b/packages/binding-opcua/test/client-test.ts @@ -40,9 +40,6 @@ describe("OPCUA Client", function () { const codecSerDes = ContentSerdes.get(); codecSerDes.addCodec(new OpcuaJSONCodec()); }); - after(async () => { - await opcuaServer.shutdown(); - }); let client: OPCUAProtocolClient; before(async function () { @@ -51,6 +48,10 @@ describe("OPCUA Client", function () { after(async () => { await client.stop(); }); + // server shall stop after client + after(async () => { + await opcuaServer.shutdown(); + }); [ // 0 diff --git a/packages/binding-opcua/test/full-opcua-thing-test.ts b/packages/binding-opcua/test/full-opcua-thing-test.ts index d339d855b..f29ec5362 100644 --- a/packages/binding-opcua/test/full-opcua-thing-test.ts +++ b/packages/binding-opcua/test/full-opcua-thing-test.ts @@ -308,6 +308,10 @@ describe("Full OPCUA Thing Test", () => { opcuaServer = await startServer(); endpoint = opcuaServer.getEndpointUrl(); debug(`endpoint = ${endpoint}`); + + // adjust TD to endpoint + thingDescription.base = endpoint; + (thingDescription.opcua as unknown as { endpoint: string }).endpoint = endpoint; }); after(async () => { await opcuaServer.shutdown();