testberry

0.4.2 • Public • Published

Testberry

Build Status

Testberry is a performance and benchmark testing framework for Node.js and Mocha

Installation

npm i testberry --save-dev

Usage

import testberry from 'testberry'
import inspect from 'inspect'

describe('Benchmark testing', () => {
  it('String starts with ', () => {
    let result

    // Calculate evaluation time
    testberry.test('.startsWith()', () => {
      result = 'foo'.startsWith('f')
    })

    // Check whether test has worked very well
    inspect(result).isTrue()

    // Next test
    testberry.test('.indexOf(0)', () => {
      result = 'foo'.indexOf(0) === 'f'
    })

    inspect(result).isTrue()

    // And a third one
    testberry.test('.test()', () => {
      result = /^f/.test('foo')
    })

    inspect(result).isTrue()
  })
})

Package Sidebar

Install

npm i testberry

Weekly Downloads

8

Version

0.4.2

License

MIT

Unpacked Size

19.4 kB

Total Files

6

Last publish

Collaborators

  • andifeind
  • kippis
  • firetux