0.1.4 • Published 8 years ago

chai-performance v0.1.4

Weekly downloads
4
License
MIT
Repository
github
Last release
8 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

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.0.9

8 years ago

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago