export default function createTapeTest({actions, imports, reducer, equalityFunction}) {
  return (`var test = require('tape');
${imports}
${reducer}
var equality = ${equalityFunction};

test('expected state returned for each action', function(assert) {
  var actions = ${JSON.stringify(actions, null, 2)};
  actions.forEach(function(action, index) {
    var result = reducer(action.prevState, action.action);
    assert.ok(equality(result, action.nextState), action.action.type + '(action index ' + index +') correctly updated state');
  });
  assert.end();
});`
  );
}
@@ -87,149 +87,150 @@
 %7B%0A  
-return (%60var test = require('tape');%0A$%7Bimports%7D%0A$%7Breducer%7D%0Avar equality = $%7BequalityFunction%7D;%0A%0Atest('expected state returned for each action
+const asserts = actions.map((action, index) =%3E %7B%0A    return %60test('$%7Baction.action.type%7D (action index $%7Bindex%7D) should correctly update state
 ', f
@@ -247,16 +247,18 @@
 sert) %7B%0A
+  
   var ac
@@ -265,92 +265,29 @@
 tion
-s
  = 
-$%7BJSON.stringify(actions, null, 2)%7D;%0A  actions.forEach(function(action, 
+actions%5B$%7B
 index
-) %7B
+%7D%5D;
 %0A   
@@ -396,110 +396,236 @@
 e), 
-action.action.type + '(action index ' + index +') correctly updated state');%0A  %7D);%0A  assert.end();%0A%7D);
+'state updated correctly');%0A    assert.end();%0A  %7D);%60%7D).join('%5Cn%5Cn');%0A  return (%60var test = require('tape');%0A$%7Bimports%7D%0A$%7Breducer%7D%0Avar equality = $%7BequalityFunction%7D;%0Avar actions = $%7BJSON.stringify(actions, null, 2)%7D;%0A%0A$%7Basserts%7D
 %60%0A  

write multiple tests for tape generation instead of asserts in a forEach loop