Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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 }
}];
return new Promise((resolve) => {
setTimeout(() => resolve(runner.sample(config)), 50);
});
}
exports.openPage = async function(hotSettings) {
const urlParams = [];
hotSettings = hotSettings || {};
var benchpress = require('@angular/benchpress');
var runner = new benchpress.Runner([
//use protractor as Webdriver client
benchpress.SeleniumWebDriverAdapter.PROTRACTOR_PROVIDERS,
//use RegressionSlopeValidator to validate samples
{provide: benchpress.Validator, useExisting: benchpress.RegressionSlopeValidator},
//use 10 samples to calculate slope regression
{provide: benchpress.RegressionSlopeValidator.SAMPLE_SIZE, useValue: 20},
//use the script metric to calculate slope regression
{provide: benchpress.RegressionSlopeValidator.METRIC, useValue: 'scriptTime'},
{provide: benchpress.Options.FORCE_GC, useValue: true}
]);
describe('deep tree baseline', function() {
it('should be fast!', function(done) {
var depth = 11;
//Tells protractor this isn't an Angular 1 application
browser.ignoreSynchronization = true;