       callback()
     , 1
 
+wirePatternMerge = ->
+  c = new noflo.Component
+  c.inPorts.add 'in1',
+    datatype: 'string'
+  c.inPorts.add 'in2',
+    datatype: 'string'
+  c.outPorts.add 'out',
+    datatype: 'string'
+
+  noflo.helpers.WirePattern c,
+    in: ['in1', 'in2']
+    out: 'out'
+    async: true
+    forwardGroups: true
+  , (data, groups, out, callback) ->
+    out.send "1#{data['in1']}#{c.nodeId}2#{data['in2']}#{c.nodeId}"
+    callback()
+
 processAsync = ->
   c = new noflo.Component
   c.inPorts.add 'in',

    loader.listComponents (err) ->
      return done err if err
      loader.registerComponent 'wirepattern', 'Async', wirePatternAsync
      loader.registerComponent 'process', 'Async', processAsync
      done()

  describe 'with WirePattern sending to Process API', ->

    setTimeout ->
      output.sendDone data + c.nodeId
    , 1

processMerge = ->
  c = new noflo.Component
  c.inPorts.add 'in1',
    datatype: 'string'
  c.inPorts.add 'in2',
    datatype: 'string'
  c.outPorts.add 'out',
    datatype: 'string'

  c.forwardGroups =
    in1: ['out']

  c.process (input, output) ->
    return unless input.has 'in1', 'in2', (ip) -> ip.type is 'data'
    second = input.get 'in2'
    until second.type is 'data'
      second = input.get 'in2'
    first = input.getData 'in1'

    output.sendDone
      out: "1#{first}#{c.nodeId}2#{second.data}#{c.nodeId}"

describe 'Scope isolation', ->
  loader = null
