1.0.1 • Published 8 years ago

bustermove v1.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

BusterMove Build Status

NPM

Hammer Time

A simple drop-in replacement for Buster in Node.js.

Uses node-tap as the test runner when in Node and tape when used packaged in Browserify (yes, that's right! You can run TAP tests, written in Buster-style, in the browser! That's surely worth an M.C. Hammer dance?).

Supports basic Buster functionality, including Sinon and referee integration and structured test suites:

var buster = require('bustermove')
  , assert = buster.assert // 'referee' is the new name for buster-assert
  , refute = buster.refute

buster.testCase('My funky tests', {
    'setUp': function (done) {
      // .. some setup stuff, run before each test, including nested tests
      done()
    }

  , 'tearDown': function (done) {
      // .. some teardown stuff, run after each test, including nested tests
      done()
    }

  , 'test something': function (done) {
      // .. whatever you're testing

      // each of these will be automatically cleaned up after the test is run
      var spy  = this.spy()
        , stub = this.stub()
        , mock = this.mock()

      done()
    }

  , 'nested': {
        'setUp': function (done) {
          // .. run after the parent setUp but before each of the nested tests
          done()          
        }

        // tearDown if you like

      , 'test nested': function (done) {
          // .. something else to test
          done()
        }
    }
})

You then run the test with either node ./tests.js or if you like, tap *-tests.js as it creates node-tap compatible tests.

Currently only this.spy(), this.stub() and this.mock() are supported in the sandbox but it's possible to make it more complete. Send me a pull request if you need it.

Licence

BusterMove is Copyright (c) 2012 Rod Vagg @rvagg and licensed under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.

1.0.1

8 years ago

1.0.0

9 years ago

0.4.1

10 years ago

0.4.0

10 years ago

0.3.2

11 years ago

0.3.1

11 years ago

0.3.0

11 years ago

0.2.1

11 years ago

0.2.0

11 years ago

0.1.0

11 years ago

0.0.1

11 years ago

0.0.0

11 years ago