mirror of
https://github.com/oven-sh/bun
synced 2026-02-02 15:08:46 +00:00
20 lines
390 B
JavaScript
20 lines
390 B
JavaScript
import * as Mitata from "mitata";
|
|
import process from "node:process";
|
|
|
|
const asJSON = !!process?.env?.BENCHMARK_RUNNER;
|
|
|
|
/** @param {Parameters<typeof Mitata["run"]>["0"]} opts */
|
|
export function run(opts = {}) {
|
|
if (asJSON) {
|
|
opts.format = "json";
|
|
}
|
|
|
|
return Mitata.run(opts);
|
|
}
|
|
|
|
export const bench = Mitata.bench;
|
|
|
|
export function group(_name, fn) {
|
|
return Mitata.group(fn);
|
|
}
|