algebra
Version:
means completeness and balancing, from the Arabic word الجبر
25 lines (20 loc) • 511 B
JavaScript
/**
* Check if unary operator is a mutator
*
* @api private
*
* @param {Object} Scalar
* @param {String} operator name
* @param {*} operand
* @param {*} resultData
*
* @returns {Function} mutatorUnaryOperatorTest
*/
function mutatorUnaryOperator (Scalar, operator, operand, resultData) {
return function mutatorUnaryOperatorTest () {
const scalar = new Scalar(operand)
const result = scalar[operator]()
result.data.should.eql(resultData)
}
}
module.exports = mutatorUnaryOperator