effects-as-data
Advanced tools
Comparing version 2.14.6 to 2.14.7
@@ -139,3 +139,3 @@ "use strict"; | ||
} catch (e) { | ||
deepEqual(e.name, "Error on Step 1"); | ||
deepEqual(e.stack.includes("Error on Step 1"), true); | ||
return; | ||
@@ -178,3 +178,3 @@ } | ||
test("testFn semantic should pass (basic)", testFn(basic, function () { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return args('foo').yieldCmd(cmds.echo('foo')).yieldReturns('foo').returns('foo'); | ||
@@ -210,3 +210,3 @@ })); | ||
// Basic with multiple steps | ||
// Basic with multiple steps | ||
@@ -248,3 +248,3 @@ test("testFn should pass (basicMultistep)", testFn(basicMultistep, function () { | ||
// Basic with multiple steps of parallel commands | ||
// Basic with multiple steps of parallel commands | ||
@@ -272,3 +272,3 @@ test("testFn should pass (basicMultistepParallel)", testFn(basicMultistepParallel, function () { | ||
// Basic with empty args | ||
// Basic with empty args | ||
@@ -307,3 +307,3 @@ test("testFn should pass (basicEmpty)", testFn(basicEmpty, function () { | ||
// Handler error handling | ||
// Handler error handling | ||
@@ -372,3 +372,3 @@ test("testFn should handle errors (badHandler)", testFn(badHandler, function () { | ||
// Async cmd | ||
// Async cmd | ||
@@ -391,3 +391,3 @@ test("testFn should pass (asyncTest)", testFn(asyncTest, function () { | ||
// Return cmd result | ||
// Throw from semantic test builder | ||
// Throw from semantic test builder | ||
@@ -414,7 +414,7 @@ function returnCmdResult() { | ||
test("testFn semantic should return cmd result", testFn(returnCmdResult, function () { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return args().yieldCmd(cmds.echo('foo')).returns("foo"); | ||
})); | ||
// Throw from semantic test builder | ||
// Throw from semantic test builder | ||
@@ -443,3 +443,3 @@ function throwSemantic() { | ||
test("testFn semantic should throw if .throws is used", testFn(throwSemantic, function () { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return args().yieldCmd(cmds.echo('foo')).yieldReturns('foo').throws(new Error("oops")); | ||
@@ -451,7 +451,7 @@ })); | ||
testFn(throwSemantic, function () { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return args().yieldCmd(cmds.echo('foo')).yieldReturns('foo').throws(new Error("wrong")); | ||
})(); | ||
} catch (e) { | ||
deepEqual(e.name, "Error on Step 2"); | ||
deepEqual(e.stack.includes("Error on Step 2"), true); | ||
return; | ||
@@ -462,6 +462,6 @@ } | ||
// Single line | ||
// Single line | ||
test("single line should pass", testSingleLine(function () { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return [[['123'], cmds.httpGet('http://example.com/api/v1/users/123')], [{ foo: 'bar' }, { foo: 'bar' }]]; | ||
@@ -478,3 +478,3 @@ })); | ||
testYieldArray(function () { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return [[[], [{ type: 'test' }]]]; | ||
@@ -481,0 +481,0 @@ })(); |
@@ -64,3 +64,2 @@ "use strict"; | ||
var stepError = "Error on Step " + (index + 1); | ||
e.name = stepError; | ||
e.stack = stepError + "\n\n" + e.stack; | ||
@@ -67,0 +66,0 @@ throw e; |
@@ -24,17 +24,5 @@ "use strict"; | ||
// @see https://gist.github.com/LeverOne/1308368 | ||
function uuid(a, b // placeholders | ||
) { | ||
for ( | ||
// loop :) | ||
b = a = ""; // b - result , a - numeric variable | ||
a++ < 36; // | ||
b += a * 51 & 52 // if "a" is not 9 or 14 or 19 or 24 | ||
? // return a random number or 4 | ||
(a ^ 15 // if "a" is not 15 | ||
? // genetate a random number from 0 to 15 | ||
8 ^ Math.random() * (a ^ 20 ? 16 : 4) // unless "a" is 20, in which case a random number from 8 to 11 | ||
: 4). // otherwise 4 | ||
toString(16) : "-" // in other cases (if "a" is 9,14,19,24) insert "-" | ||
) {} | ||
// @see https://gist.github.com/LeverOne/1308368 | ||
function uuid(a, b) { | ||
for (b = a = ""; a++ < 36; b += a * 51 & 52 ? (a ^ 15 ? 8 ^ Math.random() * (a ^ 20 ? 16 : 4) : 4).toString(16) : "-") {} | ||
return b; | ||
@@ -41,0 +29,0 @@ } |
{ | ||
"name": "effects-as-data", | ||
"version": "2.14.6", | ||
"version": "2.14.7", | ||
"description": | ||
@@ -5,0 +5,0 @@ "A micro abstraction layer for Javascript that makes writing, testing, and monitoring side-effects easy.", |
@@ -69,3 +69,3 @@ const { functions, cmds } = require("./effects"); | ||
} catch (e) { | ||
deepEqual(e.name, "Error on Step 1"); | ||
deepEqual(e.stack.includes("Error on Step 1"), true); | ||
return; | ||
@@ -122,3 +122,3 @@ } | ||
testFn(basic, () => { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return args('foo') | ||
@@ -188,3 +188,3 @@ .yieldCmd(cmds.echo('foo')).yieldReturns('foo') | ||
// Basic with multiple steps | ||
// Basic with multiple steps | ||
@@ -265,3 +265,3 @@ test( | ||
// Basic with multiple steps of parallel commands | ||
// Basic with multiple steps of parallel commands | ||
@@ -310,3 +310,3 @@ test( | ||
// Basic with empty args | ||
// Basic with empty args | ||
@@ -381,3 +381,3 @@ test( | ||
// Handler error handling | ||
// Handler error handling | ||
@@ -484,3 +484,3 @@ test( | ||
// Async cmd | ||
// Async cmd | ||
@@ -521,3 +521,3 @@ test( | ||
// Return cmd result | ||
// Throw from semantic test builder | ||
// Throw from semantic test builder | ||
@@ -531,3 +531,3 @@ function* returnCmdResult() { | ||
testFn(returnCmdResult, () => { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return args() | ||
@@ -538,3 +538,3 @@ .yieldCmd(cmds.echo('foo')).returns("foo") | ||
// Throw from semantic test builder | ||
// Throw from semantic test builder | ||
@@ -549,3 +549,3 @@ function* throwSemantic() { | ||
testFn(throwSemantic, () => { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return args() | ||
@@ -560,3 +560,3 @@ .yieldCmd(cmds.echo('foo')).yieldReturns('foo') | ||
testFn(throwSemantic, () => { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return args() | ||
@@ -567,3 +567,3 @@ .yieldCmd(cmds.echo('foo')).yieldReturns('foo') | ||
} catch (e) { | ||
deepEqual(e.name, "Error on Step 2"); | ||
deepEqual(e.stack.includes("Error on Step 2"), true); | ||
return; | ||
@@ -574,3 +574,3 @@ } | ||
// Single line | ||
// Single line | ||
@@ -580,3 +580,3 @@ test( | ||
testSingleLine(() => { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return [ | ||
@@ -602,3 +602,3 @@ [['123'], cmds.httpGet('http://example.com/api/v1/users/123')], | ||
testYieldArray(() => { | ||
// prettier-ignore | ||
// prettier-ignore | ||
return [ | ||
@@ -605,0 +605,0 @@ [[], [{ type: 'test' }]] |
@@ -55,3 +55,2 @@ const assert = require("assert"); | ||
const stepError = `Error on Step ${index + 1}`; | ||
e.name = stepError; | ||
e.stack = `${stepError}\n\n${e.stack}`; | ||
@@ -58,0 +57,0 @@ throw e; |
@@ -15,20 +15,11 @@ function isGenerator(fn) { | ||
// @see https://gist.github.com/LeverOne/1308368 | ||
function uuid( | ||
a, | ||
b // placeholders | ||
) { | ||
// @see https://gist.github.com/LeverOne/1308368 | ||
function uuid(a, b) { | ||
for ( | ||
// loop :) | ||
b = a = ""; // b - result , a - numeric variable | ||
a++ < 36; // | ||
b = a = ""; | ||
a++ < 36; | ||
b += | ||
(a * 51) & 52 // if "a" is not 9 or 14 or 19 or 24 | ||
? // return a random number or 4 | ||
(a ^ 15 // if "a" is not 15 | ||
? // genetate a random number from 0 to 15 | ||
8 ^ (Math.random() * (a ^ 20 ? 16 : 4)) // unless "a" is 20, in which case a random number from 8 to 11 | ||
: 4) // otherwise 4 | ||
.toString(16) | ||
: "-" // in other cases (if "a" is 9,14,19,24) insert "-" | ||
(a * 51) & 52 | ||
? (a ^ 15 ? 8 ^ (Math.random() * (a ^ 20 ? 16 : 4)) : 4).toString(16) | ||
: "-" | ||
); | ||
@@ -35,0 +26,0 @@ return b; |
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
262806
3848