Skip to content

Commit 860d65c

Browse files
committed
fix(vitest-plugin): escape backslashes in the isolated benchmark glob
Separators are already normalized to slashes; escaping every glob metacharacter, backslash included, makes the escaping complete.
1 parent bb5d79f commit 860d65c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎packages/vitest-plugin/src/index.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function codspeedPlugin(): Plugin {
5555
// transform and import unrelated benchmark files.
5656
const file = join(gitDir, uri.split("::")[0])
5757
.replace(/\\/g, "/")
58-
.replace(/([*?{}()[\]!+@])/g, "\\$1");
58+
.replace(/[\\*?{}()[\]!+@]/g, "\\$&");
5959
userConfig.test ??= {};
6060
userConfig.test.benchmark ??= {};
6161
userConfig.test.benchmark.include = [file];

0 commit comments

Comments
 (0)