effects-as-data
Advanced tools
Comparing version 1.1.4 to 1.1.5
'use strict'; | ||
require('babel-polyfill'); | ||
var _require = require('./run'), | ||
@@ -6,0 +4,0 @@ run = _require.run; |
@@ -27,36 +27,16 @@ 'use strict'; | ||
var runner = function _callee(handleActions, g, input, el) { | ||
var el1, _nextOutput, output, done, returnResultsAsArray, el2, actionResults1, actionResults2; | ||
var runner = function runner(handleActions, g, input, el) { | ||
var el1 = getExecutionLog(el); | ||
return regeneratorRuntime.async(function _callee$(_context) { | ||
while (1) { | ||
switch (_context.prev = _context.next) { | ||
case 0: | ||
el1 = getExecutionLog(el); | ||
_nextOutput = nextOutput(g, input), output = _nextOutput.output, done = _nextOutput.done; | ||
returnResultsAsArray = Array.isArray(output); | ||
el2 = addToExecutionLog(el1, input, output); | ||
var _nextOutput = nextOutput(g, input), | ||
output = _nextOutput.output, | ||
done = _nextOutput.done; | ||
if (!done) { | ||
_context.next = 6; | ||
break; | ||
} | ||
return _context.abrupt('return', buildPayload(el2, output)); | ||
case 6: | ||
_context.next = 8; | ||
return regeneratorRuntime.awrap(handleActions(output)); | ||
case 8: | ||
actionResults1 = _context.sent; | ||
actionResults2 = returnResultsAsArray ? actionResults1 : unwrapArgs(actionResults1); | ||
return _context.abrupt('return', runner(handleActions, g, actionResults2, el2)); | ||
case 11: | ||
case 'end': | ||
return _context.stop(); | ||
} | ||
} | ||
}, null, undefined); | ||
var returnResultsAsArray = Array.isArray(output); | ||
var el2 = addToExecutionLog(el1, input, output); | ||
if (done) return buildPayload(el2, output); | ||
return handleActions(output).then(function (actionResults1) { | ||
var actionResults2 = returnResultsAsArray ? actionResults1 : unwrapArgs(actionResults1); | ||
return runner(handleActions, g, actionResults2, el2); | ||
}); | ||
}; | ||
@@ -63,0 +43,0 @@ |
@@ -18,4 +18,2 @@ 'use strict'; | ||
var testHandlers = function _callee(fn, payload, actionHandlers, expectedOutput) { | ||
var _ref, log, outputPicker, actualOutput; | ||
return regeneratorRuntime.async(function _callee$(_context) { | ||
@@ -25,14 +23,11 @@ while (1) { | ||
case 0: | ||
_context.next = 2; | ||
return regeneratorRuntime.awrap(runTest(actionHandlers, fn, payload)); | ||
return _context.abrupt('return', runTest(actionHandlers, fn, payload).then(function (_ref) { | ||
var log = _ref.log; | ||
case 2: | ||
_ref = _context.sent; | ||
log = _ref.log; | ||
outputPicker = prop(1); | ||
actualOutput = map(outputPicker, log); | ||
var outputPicker = prop(1); | ||
var actualOutput = map(outputPicker, log); | ||
deepEqual(actualOutput, expectedOutput); | ||
})); | ||
deepEqual(actualOutput, expectedOutput); | ||
case 7: | ||
case 1: | ||
case 'end': | ||
@@ -39,0 +34,0 @@ return _context.stop(); |
{ | ||
"name": "effects-as-data", | ||
"version": "1.1.4", | ||
"version": "1.1.5", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -1,2 +0,1 @@ | ||
require('babel-polyfill') | ||
const { run } = require('./run') | ||
@@ -3,0 +2,0 @@ const { call } = require('./actions') |
@@ -20,3 +20,3 @@ const { | ||
const runner = async (handleActions, g, input, el) => { | ||
const runner = (handleActions, g, input, el) => { | ||
const el1 = getExecutionLog(el) | ||
@@ -27,5 +27,6 @@ let { output, done } = nextOutput(g, input) | ||
if (done) return buildPayload(el2, output) | ||
const actionResults1 = await handleActions(output) | ||
const actionResults2 = returnResultsAsArray ? actionResults1 : unwrapArgs(actionResults1) | ||
return runner(handleActions, g, actionResults2, el2) | ||
return handleActions(output).then((actionResults1) => { | ||
const actionResults2 = returnResultsAsArray ? actionResults1 : unwrapArgs(actionResults1) | ||
return runner(handleActions, g, actionResults2, el2) | ||
}) | ||
} | ||
@@ -32,0 +33,0 @@ |
@@ -12,6 +12,7 @@ const assert = require('chai').assert | ||
const testHandlers = async (fn, payload, actionHandlers, expectedOutput) => { | ||
let {log} = await runTest(actionHandlers, fn, payload) | ||
const outputPicker = prop(1) | ||
const actualOutput = map(outputPicker, log) | ||
deepEqual(actualOutput, expectedOutput) | ||
return runTest(actionHandlers, fn, payload).then(({log}) => { | ||
const outputPicker = prop(1) | ||
const actualOutput = map(outputPicker, log) | ||
deepEqual(actualOutput, expectedOutput) | ||
}) | ||
} | ||
@@ -18,0 +19,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
152711
2527