Skip to content

Commit fd2118b

Browse files
committed
feat(vitest-plugin): always run codspeed benchmarks when using the plugin, as hooks are not supported in the default vitest benchmark runner
1 parent ffeaa23 commit fd2118b

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

packages/vitest-plugin/src/__tests__/index.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ describe("codSpeedPlugin", () => {
4343
expect(applyPlugin).toBe(false);
4444
});
4545

46-
it("should not apply the plugin when there is no instrumentation", async () => {
46+
it("should apply the plugin when there is no instrumentation", async () => {
4747
coreMocks.Measurement.isInstrumented.mockReturnValue(false);
4848

4949
const applyPlugin = applyPluginFunction(
@@ -52,9 +52,9 @@ describe("codSpeedPlugin", () => {
5252
);
5353

5454
expect(console.warn).toHaveBeenCalledWith(
55-
"[CodSpeed] bench detected but no instrumentation found, falling back to default vitest runner"
55+
"[CodSpeed] bench detected but no instrumentation found"
5656
);
57-
expect(applyPlugin).toBe(false);
57+
expect(applyPlugin).toBe(true);
5858
});
5959

6060
it("should apply the plugin when there is instrumentation", async () => {

packages/vitest-plugin/src/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,7 @@ export default function codspeedPlugin(): Plugin {
2727
return false;
2828
}
2929
if (!Measurement.isInstrumented()) {
30-
console.warn(
31-
`[CodSpeed] bench detected but no instrumentation found, falling back to default vitest runner`
32-
);
33-
return false;
30+
console.warn("[CodSpeed] bench detected but no instrumentation found");
3431
}
3532
return true;
3633
},

0 commit comments

Comments
 (0)