Skip to content

Commit

Permalink
test(binding-coap): adjust cov:observe test
Browse files Browse the repository at this point in the history
  • Loading branch information
JKRhb committed Aug 12, 2024
1 parent 61980a9 commit a5b4711
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions packages/binding-coap/test/coap-server-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -635,7 +635,7 @@ class CoapServerTest {
await coapServer.stop();
}

@test async "should add the cov:observe subprotocol value to observable properties and events "() {
@test async "should add the correct operation types to observable properties and events "() {
const coapServer = new CoapServer({ port: 5683 });
const servient = new Servient();
servient.addServer(coapServer);
Expand Down Expand Up @@ -702,14 +702,17 @@ class CoapServerTest {
for (const event of Object.values(td.events!)) {
for (const form of event.forms) {
const opValues = form.op!;
expect(opValues.length > 0);
// eslint-disable-next-line no-unused-expressions
expect(opValues.length > 0).to.be.true;

const eventOpValueCount = filterEventOperations(opValues as Array<string>).length;
const eventOpValueCountPresent = eventOpValueCount > 0;

expect(eventOpValueCountPresent);
// eslint-disable-next-line no-unused-expressions
expect(eventOpValueCountPresent).to.be.true;

expect(form.subprotocol === "cov:observe");
// eslint-disable-next-line no-unused-expressions
expect(form.subprotocol === "cov:observe").to.be.false;
}
}

Expand Down

0 comments on commit a5b4711

Please sign in to comment.