UNPKG

masson

Version:

Module execution engine for cluster deployments.

33 lines (30 loc) 717 B
var masson = require('masson'), assert = require('assert'); exports['test in targets as an array'] = function(){ var assertions = []; var m = masson({ 'target 1': function(){ this.out(); }, 'target 2': function(){ this.out(); }, 'target 3': function(){ this.in(['target 1','target 2'],function(){ this.out(); }); } },'target 3'); m.on('before',function(context){ assertions.push('before '+context.target); }) m.on('after',function(context){ assertions.push('after '+context.target); }) process.nextTick(function(){ assert.deepEqual( ['before target 3','before target 1','after target 1','before target 2','after target 2','after target 3'], assertions ); }); };