Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

karma-referee

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

karma-referee - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

1

lib/index.js

@@ -23,2 +23,3 @@ /*global module, __dirname*/

files.unshift(createPattern(__dirname + '/../node_modules/sinon/pkg/sinon-1.7.3.js'));
files.unshift(createPattern(__dirname + '/../node_modules/formatio/lib/formatio.js'));
files.unshift(createPattern(__dirname + '/../node_modules/referee/node_modules/samsam/lib/samsam.js'));

@@ -25,0 +26,0 @@ };

5

lib/referee-adapter.js

@@ -1,2 +0,2 @@

/*global referee, refereeSinon, sinon */
/*global referee, refereeSinon, sinon, formatio*/
(function(window){

@@ -10,2 +10,5 @@ 'use strict';

var formatter = formatio.configure({ quoteStrings: false });
referee.format = function () { return formatter.ascii.apply(formatter, arguments); };
sinon.format = referee.format;
})(window);
{
"name": "karma-referee",
"description": "A Karma plugin for the Referee assertions library",
"version": "0.1.0",
"keywords": [
"karma",
"karma-plugins",
"buster",
"sinon",
"referee"
],
"scripts":{
"test": "./node_modules/.bin/mocha"
},
"repository": {
"type": "git",
"url": "git@github.com:leftieFriele/karma-referee.git"
},
"licence": "MIT",
"homepage": "https://github.com/leftieFriele/karma-referee",
"author": {
"name": "Espen Dalløkken",
"email": "leftie.friele@gmail.com"
},
"main": "lib/index.js",
"dependencies": {
"referee": "1.0.1",
"sinon": "1.7.x",
"referee-sinon": "1.0.1"
},
"devDependencies": {
"mocha": "1.15.*"
}
"name": "karma-referee",
"description": "A Karma plugin for the Referee assertions library",
"version": "0.2.0",
"keywords": [
"karma",
"karma-plugins",
"buster",
"sinon",
"referee"
],
"scripts": {
"test": "./node_modules/.bin/mocha"
},
"repository": {
"type": "git",
"url": "git@github.com:leftieFriele/karma-referee.git"
},
"licence": "MIT",
"homepage": "https://github.com/leftieFriele/karma-referee",
"author": {
"name": "Espen Dalløkken",
"email": "leftie.friele@gmail.com"
},
"main": "lib/index.js",
"dependencies": {
"referee": "1.0.2",
"sinon": "1.7.x",
"referee-sinon": "1.0.1",
"formatio": "~1.0"
},
"devDependencies": {
"mocha": "1.15.*"
}
}
karma-referee
=======================
[![NPM](https://nodei.co/npm/karma-referee.png?stars=true&downloads=true)](https://npmjs.org/package/karma-referee)
This project enables you to use [referee](https://github.com/busterjs/referee) (previously known as [buster-assertions](http://docs.busterjs.org/en/latest/modules/referees/#buster-assertions)) as part of your tests running on [Karma-runner](http://karma-runner.github.io/).
In addition to referee the plugin also expose the features in the [referee-sinon]() module which provides sinon features as part of your assertions.
In addition to referee, the plugin also exposes the features in the [referee-sinon]() module, which provides sinon-specific assertions such as `assert.calledOnce` and others. [formatio](https://github.com/busterjs/formatio) is also used to pretty-print error messages from referee and sinon.
## Instalation
## Installation
$ npm install karma-referee --save-dev
Add ``referees` as a framework:
Add ``refere`` as a framework:
frameworks: ['referee']
Then make sure you configure the ``karma-referee`` plugin.

@@ -23,7 +25,2 @@

Viola, you can now enjoy the assertions awesomeness from Referee in the comfort of your very own Karma-runner!
...
assert.isTrue(true);
refute.isTrue(object);
...
assert.calledOnce(stub);
Viola, you can now enjoy referee's assertion awesomeness from the comfort of your very own Karma-runner!
var assert = require("assert");
var formatio = require("formatio");
describe('karma adapter', function(){
beforeEach(function(){
global.window = {};
global.sinon = {};
global.referee = {'assert': {}, 'refute': {}};
global.refereeSinon = function(){}
});
global.formatio = formatio;
global.window = {};
global.sinon = {};
global.referee = {'assert': {}, 'refute': {}};
global.refereeSinon = function(){}

@@ -19,2 +19,8 @@ it('should provide the assert and refute objects', function(){

it('configures pretty-printer for referee and sinon', function(){
require('../lib/referee-adapter.js');
assert.equal(global.referee.format({ a: 1 }), '{ a: 1 }');
assert.equal(global.sinon.format({ b: 2 }), '{ b: 2 }');
});
});
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc