Constructor
new WrapSpec(params)
Parameters:
Name | Type | Description |
---|---|---|
params | WrapSpecParams |
- Source
Example
function toWrap (a, b) {}
const wrapped = shim.wrap(toWrap, {
matchArity: true,
wrapper: function () {
return function wrappedFn () {}
}
})
assert.equal(toWrap.length, wrapped.length)
Members
matchArity :boolean
Indicates that the arity of the wrapper should match the arity of the function being wrapped.
Type:
- boolean
- Source
wrapper :function
A function that wraps another function.
Type:
- function
- Source