How to use the @sinonjs/commons.deprecated.wrap function in @sinonjs/commons

To help you get started, we’ve selected a few @sinonjs/commons 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.js View on Github external
FakeXMLHttpRequest: nise.fakeXhr.FakeXMLHttpRequest,

    // fake server
    fakeServer: nise.fakeServer,
    fakeServerWithClock: nise.fakeServerWithClock,
    createFakeServer: nise.fakeServer.create.bind(nise.fakeServer),
    createFakeServerWithClock: nise.fakeServerWithClock.create.bind(nise.fakeServerWithClock),

    addBehavior: function(name, fn) {
        behavior.addBehavior(stub, name, fn);
    }
};

var legacySandboxAPI = {
    sandbox: {
        create: deprecated.wrap(
            createSandbox,
            // eslint-disable-next-line max-len
            "`sandbox.create()` is deprecated. Use default sandbox at `sinon.sandbox` or create new sandboxes with `sinon.createSandbox()`"
        )
    }
};

var sandbox = new Sandbox();

var api = extend(sandbox, legacySandboxAPI, apiMethods);

module.exports = api;
github sinonjs / referee / lib / assertions / defined.js View on Github external
assert: function(actual) {
            return deprecated.wrap(
                definedAssert,
                "defined is deprecated and will be removed in the future. Please use isUndefined instead."
            )(actual);
        },
        assertMessage: "${customMessage}Expected to be defined",