Skip to content

Commit

Permalink
Add unit test for the bug with toString and userInvocationTable #156
Browse files Browse the repository at this point in the history
  • Loading branch information
ruscoder committed May 25, 2024
1 parent 5d3e04f commit 85c9ab8
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test/user-invocation-table.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,23 @@ describe('concept', () => {
expr = "next.concept().select($this | $this.next.concept()).display";
retrieved = fhirpath.evaluate(concepts.a, expr, null, null, options);
expect(retrieved).toEqual(["B", "C"]);
});
});

describe("toString", () => {
it("Works when userInvocationTable passed without overriding toString", () => {
const options = {
userInvocationTable: {},
};

let result = fhirpath.evaluate(
{ index: 0 },
"index.toString()",
null,
null,
options
);

expect(result).toEqual(["0"]);
});
});

0 comments on commit 85c9ab8

Please sign in to comment.