How to use the @sinonjs/samsam.deepEqual function in @sinonjs/samsam

To help you get started, we’ve selected a few @sinonjs/samsam examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sinonjs / sinon / lib / sinon / proxy-call.js View on Github external
returned: function returned(value) {
        return deepEqual(this.returnValue, value);
    },
github sinonjs / sinon / lib / sinon / mock.js View on Github external
return every(arr1, function(element, i) {
        return deepEqual(arr2[i], element);
    });
}
github sinonjs / sinon / lib / sinon / proxy-call.js View on Github external
function(prev, arg, i) {
                return prev && deepEqual(self.args[i], arg);
            },
            true
github sinonjs / sinon / lib / sinon / spy.js View on Github external
function matches(fake, args, strict) {
    var margs = fake.matchingArguments;
    if (margs.length <= args.length && deepEqual(slice(args, 0, margs.length), margs)) {
        return !strict || margs.length === args.length;
    }
    return false;
}
github sinonjs / sinon / lib / sinon / util / core / deep-equal.js View on Github external
return isReallyNaN(a) && isReallyNaN(b) || a === b;
    }

    if (a instanceof Error && b instanceof Error) {
        return a === b;
    }

    if (toString(a) !== toString(b)) {
        return false;
    }

    if (join(sort(Object.keys(a))) !== join(sort(Object.keys(b)))) {
        return false;
    }

    if (samsam.deepEqual(a, b)) {
        return true;
    }

    if (matcher) {
        var keys = Object.keys(a);
        var allKeysMatch = every(keys, function (key) {
            return matcher(a[key], b[key]);
        });

        return keys.length > 0 && allKeysMatch;
    }

    return false;
};
github sinonjs / referee / lib / assertions / equals.js View on Github external
assert: function(actual, expected) {
            if (typeof expected === "undefined") {
                return this.fail(
                    "Expectation for equals should not be undefined. Use assert.defined or refute.defined instead."
                );
            }
            return samsam.deepEqual(actual, expected);
        },
        assertMessage:
github sinonjs / sinon / lib / sinon / mock-expectation.js View on Github external
return every(expectedArguments, function(expectedArgument, i) {
            if (!verifyMatcher(expectedArgument, _args[i])) {
                return false;
            }

            if (!deepEqual(_args[i], expectedArgument)) {
                return false;
            }

            return true;
        });
    },
github sinonjs / referee / lib / assertions / json.js View on Github external
assert: function(actual, expected) {
            var parsed;
            try {
                parsed = JSON.parse(actual);
            } catch (e) {
                return this.fail(parseErrorMessage);
            }
            return samsam.deepEqual(parsed, expected);
        },
        assertMessage:

@sinonjs/samsam

Value identification and comparison functions

BSD-3-Clause
Latest version published 3 months ago

Package Health Score

85 / 100
Full package analysis

Similar packages