How to use the @angular/benchpress.ConsoleReporter function in @angular/benchpress

To help you get started, we’ve selected a few @angular/benchpress examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github handsontable / performance-lab / test / runner.js View on Github external
const config = require('./../lib/config');
const benchpress = require('@angular/benchpress');
const fs = require('fs-extra');
const path = require('path');

const HOT_VERSION = process.env.HOT_VERSION;

const bindings = [
  benchpress.SeleniumWebDriverAdapter.PROTRACTOR_PROVIDERS,
  // { provide: benchpress.Options.FORCE_GC, useValue: true },
  { provide: benchpress.RegressionSlopeValidator.SAMPLE_SIZE, useValue: config.SAMPLE_SIZE },
  benchpress.JsonFileReporter.PROVIDERS,
  benchpress.MultiReporter.provideWith([
    benchpress.ConsoleReporter,
    benchpress.JsonFileReporter
  ]),
];

benchpress.Options.DEFAULT_PROVIDERS.push({
  provide: benchpress.Options.WRITE_FILE,
  useValue: (filename, content) => void process.send(content),
});

const runner = new benchpress.Runner(bindings);

exports.runSample = async function(config) {
  config.providers = [{
    provide: benchpress.Options.SAMPLE_DESCRIPTION,
    useValue: { hotVersion: HOT_VERSION }
  }];