UNPKG

@uq-its-ss/bacstack

Version:

A BACnet protocol stack written in pure JavaScript.

32 lines (29 loc) 962 B
'use strict'; const expect = require('chai').expect; const utils = require('./utils'); describe('bacstack - confirmedEventNotification integration', () => { it('should return a timeout error if no device is available', (next) => { const client = new utils.bacnetClient({apduTimeout: 200}); const date = new Date(); date.setMilliseconds(880); client.confirmedEventNotification('127.0.0.1', { processId: 3, initiatingObjectId: {}, eventObjectId: {}, timeStamp: {type: 2, value: date}, notificationClass: 9, priority: 7, eventType: 2, messageText: 'Test1234$', notifyType: 1, changeOfValueTag: 0, changeOfValueChangeValue: 90, changeOfValueStatusFlags: {bitsUsed: 24, value: [0xaa, 0xaa, 0xaa]} }, (err, value) => { expect(err.message).to.eql('ERR_TIMEOUT'); expect(value).to.eql(undefined); client.close(); next(); }); }); });