node package manager
Painless code sharing. npm Orgs help your team discover, share, and reuse code. Create a free org »

stratumn-mock-agent

stratumn-mock-agent

Allows testing a Stratumn agent

build status dependency status

Installation

npm install --save stratumn-mock-agent

Usage

import mockAgent from '../src/mockAgent';
const agent = require('agent');
 
describe('My agent', () => {
 
  const data = { message: 'test' };
 
  it('returns the state in the result on function call', done => {
    mockAgent(agent).init(data).then(res => {
      res.state.should.eql(data);
      done();
    }).catch(done);
  });
});
 

Check tests for more examples.

Credits

Stratumn Team

License

Apache License 2.0