action.mocha.js 381 B

123456789101112131415161718
  1. const tx2 = require('..')
  2. const should = require('should')
  3. describe('Action', function() {
  4. it('should notify about new action', (done) => {
  5. tx2.once('data', (dt) => {
  6. should(dt.type).eql('axm:action')
  7. should(dt.data.action_name).eql('something special')
  8. done()
  9. })
  10. tx2.action('something special', (cb) => {
  11. cb({sucess:true})
  12. })
  13. })
  14. })