@pheasantplucker/failables
Advanced tools
Comparing version 2.0.12 to 2.0.13
{ | ||
"name": "@pheasantplucker/failables", | ||
"version": "2.0.12", | ||
"version": "2.0.13", | ||
"description": "to protect against null and throwing errors", | ||
@@ -8,3 +8,3 @@ "main": "src/failable.js", | ||
"test": "jest", | ||
"lint": "esw .eslintrc.js src/ lib/ tests/ -w --fix --ignore-pattern !.eslintrc.js", | ||
"lint": "esw .eslintrc.js src/ -w --fix --ignore-pattern !.eslintrc.js", | ||
"deploy": "./deploy.sh" | ||
@@ -27,9 +27,12 @@ }, | ||
"devDependencies": { | ||
"eslint": "^4.19.1", | ||
"eslint": "^5.0.1", | ||
"eslint-plugin-jest": "^21.17.0", | ||
"eslint-plugin-prettier": "^2.6.0", | ||
"eslint-watch": "^3.1.5", | ||
"jest": "^23.1.0", | ||
"prettier": "^1.13.5" | ||
"eslint-plugin-prettier": "^2.6.1", | ||
"eslint-watch": "^4.0.0", | ||
"jest": "^23.2.0", | ||
"prettier": "^1.13.6" | ||
}, | ||
"dependencies": { | ||
"json-stringify-safe": "^5.0.1" | ||
} | ||
} |
const equal = require('assert').deepEqual | ||
const stringify = require('json-stringify-safe') | ||
@@ -37,4 +38,4 @@ const SUCCESS = 0 | ||
const assertSuccessWhich = (t, f) => { | ||
equal(isSuccess(f), true, JSON.stringify(hydrate(f))) | ||
equal(t(payload(f)), true, JSON.stringify(hydrate(f))) | ||
equal(isSuccess(f), true, stringify(hydrate(f))) | ||
equal(t(payload(f)), true, stringify(hydrate(f))) | ||
} | ||
@@ -57,7 +58,7 @@ | ||
const assertFailure = (f, p) => { | ||
equal(isFailure(f), true, JSON.stringify(hydrate(f))) | ||
equal(isFailure(f), true, stringify(hydrate(f))) | ||
if (p !== undefined) equal(payload(f), p) | ||
} | ||
const assertEmpty = f => equal(isEmpty(f), true, JSON.stringify(hydrate(f))) | ||
const assertEmpty = f => equal(isEmpty(f), true, stringify(hydrate(f))) | ||
@@ -64,0 +65,0 @@ const extractPayloads = results => results.map(payload) |
@@ -158,2 +158,8 @@ const equal = require('assert').deepEqual | ||
}) | ||
it('should not choke on circular object', () => { | ||
var circle = {} | ||
circle.a = circle | ||
assertSuccessWhich(p => true, success(circle)) | ||
assertSuccess(success(circle)) | ||
}) | ||
it('should fail success with wrong payload', () => { | ||
@@ -160,0 +166,0 @@ throws(() => assertSuccessWhich(p => p.length === 4, success('foo'))) |
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
17118
424
1
+ Addedjson-stringify-safe@^5.0.1
+ Addedjson-stringify-safe@5.0.1(transitive)