Skip to content

Commit ca27c13

Browse files
committed
test(shared): assert inline skill identity
1 parent 876871f commit ca27c13

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎packages/shared/src/inlineSkills.test.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,20 @@ describe("matchInlineSkills", () => {
2323
const first = { name: "design", displayName: "Design" };
2424
const duplicate = { name: "design", displayName: "Other design" };
2525
const namespaced = { name: "pdf:pdf" };
26-
expect([
26+
const matches = [
2727
...matchInlineSkills("Use $design then $missing and $pdf:pdf, $pdf:pdf $design", [
2828
first,
2929
duplicate,
3030
namespaced,
3131
]),
32-
]).toEqual([
32+
];
33+
expect(matches).toEqual([
3334
{ start: 4, end: 11, skill: first, rawText: "$design" },
3435
{ start: 40, end: 48, skill: namespaced, rawText: "$pdf:pdf" },
3536
{ start: 49, end: 56, skill: first, rawText: "$design" },
3637
]);
38+
expect(matches[0]?.skill).toBe(first);
39+
expect(matches[1]?.skill).toBe(namespaced);
40+
expect(matches[2]?.skill).toBe(first);
3741
});
3842
});

0 commit comments

Comments
 (0)