0.1.4 • Published 10 years ago

chai-performance v0.1.4

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

chai-performance

js-standard-style npm version

Performance test plugin for the chai assertion libary, for the browser and node

var chai = require('chai')
var perf = require('chai-performance')
chai.use(perf)

// use this to enable or disable logs on success (enabled by default in node)
perf.log = true

describe('chai-performance', function () {
  it('division should be as fast as multiplication', function (done) {
    this.timeout(50e3)
    var amount = 1e6
    expect(function () {
      for (var i = 0, j; i < amount; i++) {
        j = i * 10
      }
    }).performance({
      margin: 1,
      loop:10,
      method: function () {
        for (var i = 0, j; i < amount; i++) {
          j = i / 10
        }
      }
    }, done)
  })
})
0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago