0.4.2 • Published 3 years ago

testberry v0.4.2

Weekly downloads
175
License
MIT
Repository
-
Last release
3 years ago

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()
  })
})
0.4.1

3 years ago

0.4.0

3 years ago

0.4.2

3 years ago

0.3.0

3 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.2

6 years ago

0.1.1

7 years ago

0.1.0

8 years ago