Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
@codspeed/vitest-plugin
Advanced tools
Check out the documentation for complete integration instructions.
First, install the plugin @codspeed/vitest-plugin
and vitest
(if not already installed):
[!NOTE] The CodSpeed plugin is only compatible with vitest@1.0.0 and above.
npm install --save-dev @codspeed/vitest-plugin vitest
or with yarn
:
yarn add --dev @codspeed/vitest-plugin vitest
or with pnpm
:
pnpm add --save-dev @codspeed/vitest-plugin vitest
Let's create a fibonacci function and benchmark it with vitest.bench
:
import { describe, bench } from "vitest";
function fibonacci(n: number): number {
if (n < 2) {
return n;
}
return fibonacci(n - 1) + fibonacci(n - 2);
}
describe("fibonacci", () => {
bench("fibonacci10", () => {
fibonacci(10);
});
bench("fibonacci15", () => {
fibonacci(15);
});
});
Create or update your vitest.config.ts
file to use the CodSpeed runner:
import { defineConfig } from "vitest/config";
import codspeedPlugin from "@codspeed/vitest-plugin";
export default defineConfig({
plugins: [codspeedPlugin()],
// ...
});
Finally, run your benchmarks (here with pnpm
):
$ pnpm vitest bench --run
[CodSpeed] bench detected but no instrumentation found, falling back to default vitest runner
... Regular `vitest bench` output
And... Congrats 🎉, CodSpeed is installed in your benchmarking suite! Locally, CodSpeed will fallback to vitest since the instrumentation is only available in the CI environment for now.
You can now run those benchmarks in your CI to continuously get consistent performance measurements.
FAQs
vitest plugin for CodSpeed
The npm package @codspeed/vitest-plugin receives a total of 23,009 weekly downloads. As such, @codspeed/vitest-plugin popularity was classified as popular.
We found that @codspeed/vitest-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.