Skip to main content
Module

x/merlin/deps.ts

Testing and Benchmarking framework for deno 🧙‍♂️
Latest
import * as merlin from "https://deno.land/x/merlin@v1.0.7/deps.ts";

Classes

Handles and enforces the set rules on the historic benchmarking data.

Enums

Defines the states BenchmarkRunProgress can be in

Functions

Converts the input into a string. Objects, Sets and Maps are sorted so as to make tests less flaky

Make an assertion, error will be thrown if expr does not have truthy value.

Make an assertion that actual includes the expected values. If not then an error will be thrown.

Make an assertion that actual and expected are equal, deeply. If not deeply equal, then throw.

Make an assertion that actual is not null or undefined. If not then thrown.

Make an assertion that actual match RegExp expected. If not then thrown

Make an assertion that actual and expected are not equal, deeply. If not then throw.

Make an assertion that actual not match RegExp expected. If match then thrown

Make an assertion that actual and expected are not strictly equal. If the values are strictly equal then throw.

Make an assertion that actual object is a subset of expected object, deeply. If not, then throw.

Make an assertion that actual and expected are strictly equal. If not then throw.

Make an assertion that actual includes expected. If not then thrown.

Executes a function, expecting it to throw. If it does not, then it throws. An error class and a string that should be included in the error message can also be asserted.

Executes a function which returns a promise, expecting it to throw or reject. If it does not, then it throws. An error class and a string that should be included in the error message can also be asserted.

Deep equality comparison used in assertions

Forcefully throws a failed assertion

Use this to stub out methods that will throw when invoked.

Use this to assert unreachable code.

Registers a benchmark as a candidate for the runBenchmarks executor.

Clears benchmark candidates which name matches only and doesn't match skip. Removes all candidates if options were not provided

Runs all registered and non-skipped benchmarks serially.

Set background color to black.

Set background color to blue.

Set background color to bright black.

Set background color to bright blue.

Set background color to bright cyan.

Set background color to bright green.

Set background color to bright magenta.

Set background color to bright red.

Set background color to bright white.

Set background color to bright yellow.

Set background color to cyan.

Set background color to green.

Set background color to magenta.

Set background color to red.

Set background color using 24bit rgb. color can be a number in range 0x000000 to 0xffffff or an Rgb.

Set background color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Set background color to white.

Set background color to yellow.

Set text color to black.

Set text color to blue.

Make the text bold.

Set text color to bright black.

Set text color to bright blue.

Set text color to bright cyan.

Set text color to bright green.

Set text color to bright magenta.

Set text color to bright red.

Set text color to bright white.

Set text color to bright yellow.

Set text color to cyan.

The text emits only a small amount of light.

Get whether text color change is enabled or disabled.

Set text color to gray.

Set text color to green.

Make the text hidden.

Invert background color and text color.

Make the text italic.

Set text color to magenta.

Set text color to red.

Reset the text modified

Set text color using 24bit rgb. color can be a number in range 0x000000 to 0xffffff or an Rgb.

Set text color using paletted 8bit colors. https://en.wikipedia.org/wiki/ANSI_escape_code#8-bit

Set changing text color to enabled or disabled

Put horizontal line through the center of the text.

Remove ANSI escape codes from the string.

Make the text underline.

Set text color to white.

Set text color to yellow.

Calculates the min, max, mean (as (max+min)/2) and median from the measuredRunsMs array.

Calculates the standard deviation from the measuredRunsMs array.

Calculates Thresholds from the historic data for each benchmark.

Defines the default ColumnDefinitions, which are Name, Runs, Total (ms) and Average (ms)

Defines a delta column, which shows the changes for the benchmark. Shows - when there was no previous measurements for the benchmark in the history.

Returns the calculated delta for the specific benchmark in a formatted string.

Returns the calculated delta for the specific benchmark in a formatted string.

Defines multiple columns, which contain extra calculated values, like max, min, mean, median, stdDeviation.

Returns the range into which the benchmarks with had a threshold set fell.

Defines a column for each different runBenchmarks results in the history.

Defines a column which contains the indicators for the benchmarks, where provided.

Returns a function that expects a BenchmarkRunResult, which than prints the results in a nicely formatted markdown, based on the provided options.

Returns a function that expects BenchmarkRunProgress object, which than prints the benchmarking progress in a nicely formatted way, based on the provided options.

Returns a function that expects a BenchmarkRunResult, which than prints the results in a nicely formatted way, based on the provided options.

Defines a threshold result column, which shows into which range the benchmark fell. Shows - when no Threshold was provided for the given benchmark.

Defines a threshold result column, which shows the threshold ranges for the benchmark. Shows - when no Threshold was provided for the given benchmark.

Interfaces

Defines clearBenchmark's constraints by matching benchmark names.

Defines a benchmark definition with configurable runs.

Defines a benchmark through a named function.

Defines the result of a single benchmark

Defines runBenchmark's run constraints by matching benchmark names.

Defines the current progress during the run of runBenchmarks

Defines the result of a runBenchmarks call

Provides methods for starting and stopping a benchmark clock.

Defines an indicator that should be used for the matching benches

Represents the stored historic benchmark data

Represents the results of one runBenchmarks run.

Represents the results of one benchmark's single run.

Defines one column of the markdown table.

Represent the change in a variable's value.

Defines a group in the markdown.

Defines how the generated markdown should look like.

Defines the rules on what and how the history should contain.

Defines how the resulting output should look like.

Defines a threshold, which has three sections.

Defines Threshold-s for specific benches. Each key of this object should correspond to a specific benchmark's name

Type Aliases

Defines how the resulting output should look like.

Defines which strict rules to use.