New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More →

referee

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

referee - npm Package Compare versions

Comparing version

to
1.1.0

module.exports = {
linter: "jshint",
paths: [
"lib/*.js",
"test/*.js"
"lib/**/*.js",
"test/**/*.js"
],

@@ -9,6 +10,6 @@ linterOptions: {

browser: true,
plusplus: true,
sloppy: true,
vars: true,
nomen: true,
plusplus: false,
strict: false,
onevar: false,
nomen: false,
regexp: true,

@@ -15,0 +16,0 @@ predef: [

((typeof define === "function" && define.amd && function (m) {
define("referee/expect", ["lodash", "referee"], m);
define("expect", ["lodash"], m);
}) || (typeof module === "object" && function (m) {
module.exports = m(require("lodash"), require("./referee"));
}) || function (m) { this.referee.expect = m(this._, this.referee); }
)(function (_, referee) {
module.exports = m(require("lodash"));
}) || function (m) { this.expect = m(this._); }
)(function (_) {
var expectation = {};

@@ -23,3 +23,3 @@ function F() {}

expect.wrapAssertion = function (assertion, expectation) {
expect.wrapAssertion = function (assertion, expectation, referee) {
expect.expectation[expectation] = function () {

@@ -51,17 +51,19 @@ var args = [this.actual].concat(_.toArray(arguments));

_.each(_.keys(referee.assert), function (name) {
var expectationName = referee.assert[name].expectationName;
if (expectationName) {
expect.wrapAssertion(name, expectationName);
}
});
expect.init = function (referee) {
_.each(_.keys(referee.assert), function (name) {
var expectationName = referee.assert[name].expectationName;
if (expectationName) {
expect.wrapAssertion(name, expectationName, referee);
}
});
expect.wrapAssertion("assert", "toBeTruthy");
expect.wrapAssertion("refute", "toBeFalsy");
expect.wrapAssertion("assert", "toBeTruthy", referee);
expect.wrapAssertion("refute", "toBeFalsy", referee);
if (expect.expectation.toBeNear) {
expect.expectation.toBeCloseTo = expect.expectation.toBeNear;
}
if (expect.expectation.toBeNear) {
expect.expectation.toBeCloseTo = expect.expectation.toBeNear;
}
};
return expect;
});
((typeof define === "function" && define.amd && function (m) {
define("referee", ["lodash", "samsam", "bane"], m);
define("referee", ["expect", "lodash", "samsam", "bane"], m);
}) || (typeof module === "object" && function (m) {
module.exports = m(require("lodash"), require("samsam"), require("bane"));
}) || function (m) { this.referee = m(this._, this.samsam, this.bane); }
)(function (_, samsam, bane) {
module.exports = m(
require("./expect"),
require("lodash"),
require("samsam"),
require("bane")
);
}) || function (m) {
this.referee = m(
this.expect,
this._,
this.samsam,
this.bane
);
})(function (expect, _, samsam, bane) {
"use strict";

@@ -116,3 +127,3 @@

if (referee.expect && referee.expect.wrapAssertion) {
referee.expect.wrapAssertion(name, opt.expectation);
referee.expect.wrapAssertion(name, opt.expectation, referee);
} else {

@@ -463,3 +474,3 @@ assert[name].expectationName = opt.expectation;

var keyCnt = 0;
for (var i=0; i < keys.length; i++) {
for (var i = 0; i < keys.length; i++) {
keyMap[keys[i]] = true;

@@ -502,3 +513,3 @@ keyCnt += 1;

message = matcher;
matcher = function(err) {
matcher = function (err) {
return referee.match(err, message);

@@ -674,10 +685,8 @@ };

if (typeof module !== "undefined" && typeof require === "function") {
referee.expect = function () {
referee.expect = require("./expect");
return referee.expect.apply(referee, arguments);
};
}
referee.expect = function () {
expect.init(referee);
return expect.apply(referee, arguments);
};
return referee;
});
{
"name": "referee",
"version": "1.0.3",
"version": "1.1.0",
"description": "Assertions for any JavaScript test framework and environment",

@@ -5,0 +5,0 @@ "homepage": "http://busterjs.org/docs/referee",

@@ -26,2 +26,6 @@ # referee

**1.1.0** (31.10.2014)
* fix for issue [#402 - referee.expect fails if path.resolve gets stubbed](https://github.com/busterjs/buster/issues/402)
**1.0.3** (30.04.2014)

@@ -38,3 +42,3 @@

1. `npm test` - runs node tests
### Browsers

@@ -41,0 +45,0 @@

Sorry, the diff of this file is not supported yet