Skip to content

Commit 85c9ab8

Browse files
committed
Add unit test for the bug with toString and userInvocationTable #156
1 parent 5d3e04f commit 85c9ab8

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

test/user-invocation-table.test.js

+17
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,23 @@ describe('concept', () => {
7575
expr = "next.concept().select($this | $this.next.concept()).display";
7676
retrieved = fhirpath.evaluate(concepts.a, expr, null, null, options);
7777
expect(retrieved).toEqual(["B", "C"]);
78+
});
79+
});
80+
81+
describe("toString", () => {
82+
it("Works when userInvocationTable passed without overriding toString", () => {
83+
const options = {
84+
userInvocationTable: {},
85+
};
86+
87+
let result = fhirpath.evaluate(
88+
{ index: 0 },
89+
"index.toString()",
90+
null,
91+
null,
92+
options
93+
);
7894

95+
expect(result).toEqual(["0"]);
7996
});
8097
});

0 commit comments

Comments
 (0)