How to use the @sinonjs/referee.assert function in @sinonjs/referee

To help you get started, we’ve selected a few @sinonjs/referee 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 / test / webworker / webworker-support-assessment.js View on Github external
"use strict";

var referee = require("@sinonjs/referee");
var assert = referee.assert;

if (typeof Worker !== "undefined") {
    describe("WebWorker support", function() {
        var sentMessage = "whatever";
        it("should not crash", function(done) {
            var worker = new Worker("/test/webworker/webworker-script.js");

            worker.onmessage = function(msg) {
                // eslint-disable-next-line no-restricted-syntax
                try {
                    assert.same(msg.data, "worker received:" + sentMessage);
                    done();
                } catch (err) {
                    done(err);
                }
            };
github sinonjs / sinon / test / restore-object.js View on Github external
"use strict";
/* eslint-disable no-empty-function */

var referee = require("@sinonjs/referee");
var sinonSpy = require("../lib/sinon/spy");
var sinonStub = require("../lib/sinon/stub");
var restoreObject = require("../lib/sinon/restore-object.js");
var assert = referee.assert;
var refute = referee.refute;

describe("restore-object", function() {
    it("is defined", function() {
        assert.isFunction(restoreObject);
    });

    it("works on empty objects", function() {
        refute.exception(function() {
            restoreObject({});
        });
    });

    it("quietly ignores falsy input", function() {
        refute.exception(function() {
            restoreObject(false);
github sinonjs / sinon / test / shared-spy-stub-everything-tests.js View on Github external
"use strict";

var referee = require("@sinonjs/referee");
var assert = referee.assert;
var refute = referee.refute;

module.exports = function shared(createSpyOrStub) {
    it("replaces all methods of an object when no property is given", function() {
        var obj = {
            func1: function() {
                return;
            },
            func2: function() {
                return;
            },
            func3: function() {
                return;
            }
        };

@sinonjs/referee

Assertions for any JavaScript test framework and environment

BSD-3-Clause
Latest version published 9 months ago

Package Health Score

67 / 100
Full package analysis

Similar packages