Skip to content

Commit 07bb1f1

Browse files
committed
Older array creation to make check-types happier
1 parent 272e0d5 commit 07bb1f1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/shared/__tests__/context-mentions.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ describe("mentionRegex and mentionRegexGlobal", () => {
5959
}
6060

6161
// Test mentionRegexGlobal (all matches)
62-
const globalMatches = [...input.matchAll(mentionRegexGlobal)].map((m) => m[0])
62+
const globalMatches = Array.from(input.matchAll(mentionRegexGlobal)).map((m) => m[0])
6363
if (expected) {
6464
expect(globalMatches).toEqual(expected)
6565
} else {
@@ -70,7 +70,7 @@ describe("mentionRegex and mentionRegexGlobal", () => {
7070

7171
it("should correctly capture the mention part (group 1)", () => {
7272
const input = "Mention @/path/to/escaped\\ file.txt and @problems"
73-
const matches = [...input.matchAll(mentionRegexGlobal)]
73+
const matches = Array.from(input.matchAll(mentionRegexGlobal))
7474

7575
expect(matches.length).toBe(2)
7676
expect(matches[0][1]).toBe("/path/to/escaped\\ file.txt") // Group 1 should not include '@'

0 commit comments

Comments
 (0)