-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #95 from tago-io/fix/connector-khomp-itg-402
Adding condition checking if a payload is a device uplink.
- Loading branch information
Showing
4 changed files
with
268 additions
and
236 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
/* eslint-disable unicorn/numeric-separators-style */ | ||
import { describe, expect, test } from "vitest"; | ||
|
||
import { decoderRun } from "../../../../../src/functions/decoder-run"; | ||
|
||
const file_path = "/decoders/connector/khomp/its-402/v1.0.0/payload.ts" as const; | ||
|
||
describe("The data below should not be parsed", () => { | ||
let payload = [ | ||
{ variable: "Temperature", value: "04096113950292" }, | ||
{ variable: "fport", value: 9 }, | ||
]; | ||
|
||
let device = { params: [{ key: "language", value: "EN" }] }; | ||
payload = decoderRun(file_path, { payload, device }); | ||
test("Output Result", () => { | ||
expect(Array.isArray(payload)).toBe(true); | ||
}); | ||
|
||
test("Not parsed Result", () => { | ||
expect(payload).toEqual([ | ||
{ variable: "Temperature", value: "04096113950292" }, | ||
{ variable: "fport", value: 9 }, | ||
]); | ||
}); | ||
}); |
Oops, something went wrong.