Skip to content

Commit

Permalink
Add test for method with underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
mbraak committed Feb 2, 2025
1 parent 2cde2ee commit 8cd13a2
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/test/jqTree/methods.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1535,3 +1535,11 @@ describe("updateNode", () => {
});
});
});

it("returns undefined when calling with a strint that starts with an underscore", () => {
const $tree = $("#tree1");

const tree = $tree.tree as unknown as (name: string) => undefined;
const result = tree("_test"); // eslint-disable-line @typescript-eslint/no-confusing-void-expression
expect(result).toBeUndefined();
});

0 comments on commit 8cd13a2

Please sign in to comment.