Creates a new (Suite:class).
The name of the (Suite:class)
Options for the (Suite:class)
import { Suite } from '@jonahsnider/benchmark';
const suite = new Suite('concatenation', { warmup: { durationMs: 10_000 }, run: { durationMs: 10_000 } });
Suites that specify a filepath can be run in a separate thread in a (Benchmark:class).
import { Suite } from '@jonahsnider/benchmark';
const suite = new Suite('concatenation', {
warmup: { durationMs: 10_000 },
run: { durationMs: 10_000 },
filepath: import.meta.url
});
Readonly
nameThe name of the (Suite:class)
Readonly
optionsOptions for running this (Suite:class) and its warmup.
The tests in this (Suite:class).
This (Suite:class)'s filepath, if it was provided. Used for running the (Suite:class) in a separate thread.
Adds a test to this (Suite:class).
The name of the test
The test to add
this
Creates and adds a test to this (Suite:class).
The name of the test
The function to run
this
A collection of (Test:class)s that are different implementations of the same thing (ex. different ways of sorting an array).
Example