DPT13 100% coverage.
This commit is contained in:
parent
dcb3d2bea9
commit
df8c52f112
@ -42,6 +42,20 @@ describe("Test DPT013", (): void => {
|
||||
expect(compareBuffers(dpt.encoder(value), buffer)).is.true;
|
||||
});
|
||||
|
||||
it("encode not integer", async function () {
|
||||
var testFunction = function () {
|
||||
const value = dpt.encoder(Math.PI)
|
||||
}
|
||||
expect(testFunction).to.throw(InvalidValueError);
|
||||
});
|
||||
|
||||
it("encode out of range", async function () {
|
||||
var testFunction = function () {
|
||||
const value = dpt.encoder(-Math.pow(2, 31) - 1)
|
||||
}
|
||||
expect(testFunction).to.throw(InvalidValueError);
|
||||
});
|
||||
|
||||
it("encode undefined", async function () {
|
||||
var testFunction = function () {
|
||||
const value = dpt.encoder(undefined)
|
||||
|
Loading…
Reference in New Issue
Block a user