diff --git a/packages/binding-coap/test/coap-server-test.ts b/packages/binding-coap/test/coap-server-test.ts index 9dfcf9e36..901c952cb 100644 --- a/packages/binding-coap/test/coap-server-test.ts +++ b/packages/binding-coap/test/coap-server-test.ts @@ -127,10 +127,8 @@ class CoapServerTest { }, }); - testThing.setActionHandler("try", (input: WoT.InteractionOutput) => { - return new Promise((resolve, reject) => { - resolve("TEST"); - }); + testThing.setActionHandler("try", async (input: WoT.InteractionOutput) => { + return "TEST"; }); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore @@ -444,11 +442,9 @@ class CoapServerTest { // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore testThing.properties.test.forms = []; - testThing.setActionHandler("try", (input: WoT.InteractionOutput, params?: InteractionOptions) => { - return new Promise((resolve, reject) => { - expect(params?.uriVariables).to.deep.equal({ step: 5 }); - resolve("TEST"); - }); + testThing.setActionHandler("try", async (input: WoT.InteractionOutput, params?: InteractionOptions) => { + expect(params?.uriVariables).to.deep.equal({ step: 5 }); + return "TEST"; }); // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-ignore