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

empower

Package Overview
Dependencies
Maintainers
1
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

empower - npm Package Compare versions

Comparing version 0.3.3 to 0.3.4

test/buster_assertions_test.js

7

bower.json
{
"name": "empower",
"version": "0.3.3",
"version": "0.3.4",
"main": "lib/empower.js",

@@ -17,3 +17,3 @@ "ignore": [

"devDependencies": {
"espower": "~0.3.0",
"espower": "~0.3.1",
"esprima": "~1.0.4",

@@ -23,4 +23,5 @@ "escodegen": "~1.0.1",

"requirejs": "~2.1.5",
"assert": "Jxck/assert"
"assert": "Jxck/assert",
"buster.js": "~0.7.0"
}
}

@@ -99,3 +99,3 @@ /**

powerAssert = function powerAssert (context, message) {
enhancement.ok(context, message);
enhancement(context, message);
};

@@ -109,3 +109,3 @@ extend(powerAssert, assertFunction);

var events = [],
enhancement = {};
enhancement = (typeof target === 'function') ? decorateOneArg(target, formatter) : {};

@@ -112,0 +112,0 @@ function _capt (value, kind, location) {

{
"name": "empower",
"description": "Power Assert feature enhancer for assert function/object",
"version": "0.3.3",
"version": "0.3.4",
"keywords": [

@@ -45,3 +45,4 @@ "test",

"bower": "~1.2.8",
"grunt-bower-requirejs": "~0.8.0"
"grunt-bower-requirejs": "~0.8.0",
"buster-assertions": "~0.10.4"
},

@@ -48,0 +49,0 @@ "licenses": [

@@ -18,3 +18,3 @@ empower

`empower` works with standard `assert` function (best fit with [Mocha](http://visionmedia.github.io/mocha/)), and also supports assert-like objects provided by various testing frameworks such as [QUnit](http://qunitjs.com/) or [nodeunit](https://github.com/caolan/nodeunit).
`empower` works with standard `assert` function (best fit with [Mocha](http://visionmedia.github.io/mocha/)), and also supports assert-like objects/functions provided by various testing frameworks such as [QUnit](http://qunitjs.com/), [buster.js](http://docs.busterjs.org/en/latest/), and [nodeunit](https://github.com/caolan/nodeunit).

@@ -25,2 +25,15 @@

SUPPORTED ASSERTION LIBRARIES
---------------------------------------
* [Node assert API](http://nodejs.org/api/assert.html)
* [Jxck/assert](https://github.com/Jxck/assert)
ASSERTION LIBRARIES KNOWN TO WORK
---------------------------------------
* [QUnit.assert](http://qunitjs.com/)
* [nodeunit](https://github.com/caolan/nodeunit)
* [buster-assertions](http://docs.busterjs.org/en/latest/modules/buster-assertions/)
AUTHOR

@@ -27,0 +40,0 @@ ---------------------------------------

@@ -61,14 +61,30 @@ (function (root, factory) {

context.location.path,
context.content
context.content,
JSON.stringify(context.events)
].join('\n');
};
},
assert = empower(baseAssert, fakeFormatter);
test('empowered function also acts like an assert function', function () {
var falsy = 0;
try {
eval(weave('assert(falsy);'));
assert.ok(false, 'AssertionError should be thrown');
} catch (e) {
baseAssert.equal(e.name, 'AssertionError');
baseAssert.equal(e.message, [
'/path/to/some_test.js',
'assert(falsy);',
'[{"value":0,"kind":"ident","location":{"start":{"line":1,"column":7}}}]'
].join('\n'));
}
});
suite('assertion method with one argument', function () {
var assert = empower(baseAssert, fakeFormatter);
test('Identifier', function () {
var falsy = 0;
try {
eval(weave('assert(falsy);'));
eval(weave('assert.ok(falsy);'));
assert.ok(false, 'AssertionError should be thrown');

@@ -79,3 +95,4 @@ } catch (e) {

'/path/to/some_test.js',
'assert(falsy);'
'assert.ok(falsy);',
'[{"value":0,"kind":"ident","location":{"start":{"line":1,"column":10}}}]'
].join('\n'));

@@ -88,4 +105,2 @@ }

suite('assertion method with two arguments', function () {
var assert = empower(baseAssert, fakeFormatter);
test('both Identifier', function () {

@@ -100,3 +115,4 @@ var foo = 'foo', bar = 'bar';

'/path/to/some_test.js',
'assert.equal(foo, bar);'
'assert.equal(foo, bar);',
'[{"value":"foo","kind":"ident","location":{"start":{"line":1,"column":13}}},{"value":"bar","kind":"ident","location":{"start":{"line":1,"column":18}}}]'
].join('\n'));

@@ -115,3 +131,4 @@ }

'/path/to/some_test.js',
'assert.equal("foo", bar);'
'assert.equal("foo", bar);',
'[{"value":"bar","kind":"ident","location":{"start":{"line":1,"column":20}}}]'
].join('\n'));

@@ -130,3 +147,4 @@ }

'/path/to/some_test.js',
'assert.equal(foo, "bar");'
'assert.equal(foo, "bar");',
'[{"value":"foo","kind":"ident","location":{"start":{"line":1,"column":13}}}]'
].join('\n'));

@@ -133,0 +151,0 @@ }

@@ -5,3 +5,3 @@ var require = {

"es5-shim": "../bower_components/es5-shim/es5-shim",
escodegen: '../bower_components/escodegen/escodegen.browser',
escodegen: "../bower_components/escodegen/escodegen.browser",
esprima: "../bower_components/esprima/esprima",

@@ -11,3 +11,4 @@ estraverse: "../bower_components/estraverse/estraverse",

mocha: "../bower_components/mocha/mocha",
requirejs: "../bower_components/requirejs/require"
requirejs: "../bower_components/requirejs/require",
"buster-assertions": "../bower_components/buster.js/buster-test"
},

@@ -19,5 +20,8 @@ shim: {

escodegen: {
exports: 'escodegen'
exports: "escodegen"
},
"buster-assertions": {
exports: "buster"
}
}
};

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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