Comparing version 0.7.0 to 0.7.1
{ | ||
"name": "empower", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"main": "lib/empower.js", | ||
@@ -15,3 +15,3 @@ "ignore": [ | ||
"espower": "~0.7.0", | ||
"esprima": "~1.2.0", | ||
"esprima": "~1.2.1", | ||
"escodegen": "1.3.0", | ||
@@ -24,4 +24,4 @@ "mocha": "~1.18.2", | ||
"resolutions": { | ||
"esprima": "1.2.0" | ||
"esprima": "~1.2.1" | ||
} | ||
} |
@@ -183,3 +183,3 @@ /** | ||
function isEspoweredValue (value) { | ||
return (typeof value !== 'undefined') && (typeof value.powerAssertContext !== 'undefined'); | ||
return (typeof value === 'object') && (value !== null) && (typeof value.powerAssertContext !== 'undefined'); | ||
} | ||
@@ -186,0 +186,0 @@ |
{ | ||
"name": "empower", | ||
"description": "Power Assert feature enhancer for assert function/object", | ||
"version": "0.7.0", | ||
"version": "0.7.1", | ||
"keywords": [ | ||
@@ -6,0 +6,0 @@ "power-assert", |
@@ -61,2 +61,35 @@ (function (root, factory) { | ||
test('Bug reproduction. should not fail if argument is null Literal. ' + JSON.stringify(option), function () { | ||
var foo = 'foo'; | ||
try { | ||
eval(weave('assert.equal(foo, null);')); | ||
assert.ok(false, 'AssertionError should be thrown'); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
if (option.modifyMessageOnFail) { | ||
baseAssert.equal(e.message, [ | ||
'/path/to/some_test.js', | ||
'assert.equal(foo, null)', | ||
'[{"value":"foo","espath":"arguments/0"}]' | ||
].join('\n')); | ||
} | ||
if (option.saveContextOnFail) { | ||
baseAssert.deepEqual(e.powerAssertContext, { | ||
"source":{ | ||
"content":"assert.equal(foo, null)", | ||
"filepath":"/path/to/some_test.js", | ||
"line": 1 | ||
}, | ||
"args":[ | ||
{ | ||
"value":"foo", | ||
"events":[{"value":"foo","espath":"arguments/0"}] | ||
} | ||
] | ||
}); | ||
} | ||
} | ||
}); | ||
test(JSON.stringify(option) + ' empowered function also acts like an assert function', function () { | ||
@@ -63,0 +96,0 @@ var falsy = 0; |
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
46227
1059
11