hifive

Your friendly minimal BDD library.

npm install hifive
19 downloads in the last day
82 downloads in the last week
118 downloads in the last month

Hi-Five

Build Status Dependencies Status NPM version unstable

browser support

Minimal BDD test runner that plays along nicely with Browserify.

Philosophy

  • Not-A-Framework: Hi-five should let you, the programmer, lead the way and define how testing should be done. Bring your own reporters & assertion libraries.

  • Run anywhere: Hi-five should run in any JS VM that supports at least the ECMAScript 3 specification.

  • Easy to integrate: Hi-five should be easy to integrate with any CI or other system.

  • Support async: Hi-five should support asynchronous tests as first-class.

Example

var spec   = require('hifive')()
var assert = require('assert')

spec('λ compose', function(it) {
  it('compose(f, g)(x) should be the same as f(g(x))', function() {
    assert.strictEqual(f(g(x)), compose(f, g)(x))
  })
})

spec.run(require('hifive-minimal')())

Then:

$ node run test.js
Success. 1/1 tests.

Installing

The easiest way is to grab it from NPM (if you're in the Browser, use Browserify):

$ npm install hifive

If you don't want to use NPM and/or Browserify, you'll need to compile the library yourself. You'll need Git, Make and Node.js:

$ git clone git://github.com/hifivejs/hifive.git
$ cd hifive
$ npm install
$ make bundle

And use the dist/hifive.umd.js file without a module system, or with an AMD module system like Require.js.

Documentation

You can either check the documentation on-line, or build them locally. To build the documentation you'll need to install type.writer, and Node.js:

$ npm install
$ make documentation

This will generate the documentation as a series of HTML files on docs/build.

Tests

On Node:

$ npm test

On the browser:

$ npm install -g hifive-browser
$ hifive-browser serve test/specs/index.js
# Then open the link on any browser

Platform support

This library assumes an ES5 environment, but can be easily supported in ES3 platforms by the use of shims. Just include es5-shim :3

Licence

Copyright (c) 2013 Quildreen Motta.

Released under the MIT licence.

npm loves you