How to use the @sinonjs/commons.deprecated 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 / referee / lib / test-helper / index.js View on Github external
setUp: function() {
        sinon.spy(referee, "fail");
        testHelper.okListener = sinon.spy();
        referee.on("pass", testHelper.okListener);
        testHelper.failListener = sinon.spy();
        referee.on("failure", testHelper.failListener);
        sinon.replace(commons.deprecated, "wrap", function(f) {
            return f;
        });
    },
github sinonjs / referee / lib / assertions / defined.js View on Github external
"use strict";

var actualAndTypeOfMessageValues = require("../actual-and-type-of-message-values");
var deprecated = require("@sinonjs/commons").deprecated;

module.exports = function(referee) {
    function definedAssert(actual) {
        return typeof actual !== "undefined";
    }
    referee.add("defined", {
        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",
        refuteMessage:
            "${customMessage}Expected ${actual} (${actualType}) not to be defined",
        expectation: "toBeDefined",
github sinonjs / sinon / lib / sinon.js View on Github external
"use strict";

var behavior = require("./sinon/behavior");
var createSandbox = require("./sinon/create-sandbox");
var deprecated = require("@sinonjs/commons").deprecated;
var extend = require("./sinon/util/core/extend");
var fakeTimers = require("./sinon/util/fake-timers");
var format = require("./sinon/util/core/format");
var nise = require("nise");
var Sandbox = require("./sinon/sandbox");
var stub = require("./sinon/stub");

var apiMethods = {
    createSandbox: createSandbox,
    assert: require("./sinon/assert"),
    match: require("@sinonjs/samsam").createMatcher,
    restoreObject: require("./sinon/restore-object"),
    spyCall: require("./sinon/proxy-call"),

    expectation: require("./sinon/mock-expectation"),
    defaultConfig: require("./sinon/util/core/default-config"),