Skip to content

A simple class wrapping around to let you easily load test a function and get its average

Notifications You must be signed in to change notification settings

French-Exception/node-function-load-perf-tester

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

Simple wrapping execution of function n'th times around performance = and returns average.

Purpose here is to facilitate coding of functional tests with load-testing.

Bear in mind that most of CI tests CAN run under heavy-load.

Installation

npm i --save @frenchex/function-load-perf-tester-lib

Basic usage

import {expect} from 'chai';

it('is performant construction', async function () {
        const tester = new FunctionLoadTesterSpecs();

        (await tester
            .measureAverage(async () => {
                    // your code here
                },
                100, // execute 100 times to generate an average
                expect // wrapping function for resulting average
            ))
            .to.be.lte(1, `Construction must be lte`); //which let us fluently test return

    });

About

A simple class wrapping around to let you easily load test a function and get its average

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published