hamjest
Version:
A library of composable matchers for defining meaningful and readable assertions in JavaScript.
22 lines (17 loc) • 468 B
JavaScript
;
const _ = require('lodash');
const Matcher = require('./Matcher');
function IsSame(expectedValue) {
return _.create(new Matcher(), {
matches: function (actualValue) {
return expectedValue === actualValue;
},
describeTo: function (description) {
description.append('same instance (').appendValue(expectedValue).append(')');
}
});
}
IsSame.strictlyEqualTo = function (operand) {
return new IsSame(operand);
};
module.exports = IsSame;