function commonPostInitSetup(args, spy) {
        const [object, property, types] = args;

        const isSpyingOnEntireObject =
            typeof property === "undefined" && typeof object === "object";

        if (isSpyingOnEntireObject) {
            const ownMethods = collectOwnMethods(spy);

            forEach(ownMethods, function (method) {
                addToCollection(method);
            });

            usePromiseLibrary(promiseLib, ownMethods);
        } else if (Array.isArray(types)) {
            for (const accessorType of types) {
                addToCollection(spy[accessorType]);
                usePromiseLibrary(promiseLib, spy[accessorType]);
            }
        } else {
            addToCollection(spy);
            usePromiseLibrary(promiseLib, spy);
        }

        return spy;
    }
Replace an existing property

@param {object|Function} object
@param {string} property
@param {*} replacement a fake, stub, spy or any other value
@returns {*}