chai-builder
Advanced tools
Comparing version 0.2.2 to 0.2.3
17
index.js
@@ -17,3 +17,3 @@ // Generated by CoffeeScript 1.8.0 | ||
return use = function(chai, utils) { | ||
var Assertion, Expectation, assertionChainableMethods, assertionKeys, assertionProperties, chainCall, chainProperty; | ||
var Assertion, Expectation, assertionChainableMethods, assertionPropertyNames, chainCall, chainProperty; | ||
Assertion = chai.Assertion; | ||
@@ -47,8 +47,8 @@ Expectation = (function() { | ||
})(); | ||
assertionKeys = Object.keys(Assertion.prototype); | ||
assertionProperties = Object.getOwnPropertyNames(Assertion.prototype); | ||
assertionPropertyNames = Object.getOwnPropertyNames(Assertion.prototype); | ||
assertionChainableMethods = Object.keys(Assertion.prototype.__methods); | ||
assertionProperties.forEach(function(name) { | ||
assertionPropertyNames.forEach(function(name) { | ||
var descriptor; | ||
if (assertionChainableMethods.indexOf(name) >= 0) { | ||
return Object.defineProperty(Expectation.prototype, name, { | ||
Object.defineProperty(Expectation.prototype, name, { | ||
get: function() { | ||
@@ -65,3 +65,6 @@ var next; | ||
}); | ||
} else if (assertionKeys.indexOf(name) >= 0) { | ||
return; | ||
} | ||
descriptor = Object.getOwnPropertyDescriptor(Assertion.prototype, name); | ||
if (typeof descriptor.value === 'function') { | ||
return Expectation.prototype[name] = function() { | ||
@@ -72,3 +75,3 @@ var callArgs; | ||
}; | ||
} else { | ||
} else if (typeof descriptor.get === 'function') { | ||
return Object.defineProperty(Expectation.prototype, name, { | ||
@@ -75,0 +78,0 @@ get: function() { |
{ | ||
"name": "chai-builder", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "First class expressive expectations", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
13133
104