Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

test-aaa

1.0.2 • Public • Published

Test AAA

Build Status

Arrange, Act, Assert because nobody likes messy tests.

Install

npm install --save-dev test-aaa

Use

var aaa = require('test-aaa');
 
describe('Foo', function () {
  it('should bar', aaa({
    arrange: function () {
      // do stuff and return test subject
    },
    act: function (subject) {
      // act on test subject and return actual value
    },
    assert: function (actual) {
      // assert on the actual value
    }
  }));
});

The aaa function takes a props object with arrange, act, and assert keys and returns a new function that executes arrange, act, and assert in sequence. The arrange function should return the test subject. The act function receives the test subject to act upon it and returns the actual value. Then assert receives the actual value to perform assertions on it.

Install

npm i test-aaa

DownloadsWeekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • avatar