Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Trend as a number and now as a string, Dexcom EU changed the type of Trend to string #51

Merged
merged 3 commits into from
Dec 1, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Update test to support Trend as number and as string
Check that Trend is a number or a string as both may be returned by Dexcom API.
cpitchford authored Dec 1, 2021
commit 0136e419a4153de44f59cfca37f38084882e2b7c
7 changes: 6 additions & 1 deletion tests/authorize_fetch.test.js
Original file line number Diff line number Diff line change
@@ -26,7 +26,12 @@ describe("authorize_fetch", () => {
.be.an.instanceOf(Object);
glucose[0].DT.should.be.a.String().and.containEql("Date");
glucose[0].ST.should.be.a.String().and.containEql("Date");
glucose[0].Trend.should.be.a.Number();
glucose[0].Trend.should.exist();
if (typeof glucose[0].Trend === "string") {
glucose[0].Trend.should.be.a.String();
} else {
glucose[0].Trend.should.be.a.Number();
}
glucose[0].Value.should.be.a.Number();
glucose[0].WT.should.be.a.String().and.containEql("Date");