Comparing version 0.10.0 to 0.11.0
@@ -0,1 +1,10 @@ | ||
## [0.11.0](https://github.com/twada/empower/releases/tag/v0.11.0) (2015-04-18) | ||
#### Features | ||
* **empower:** | ||
* ship npm module with built bundle for browsers ([e9448d3b](https://github.com/twada/empower/commit/e9448d3bfd4b44e64810cb2d1e18d6a4e2c6ba4b)) | ||
## [0.10.0](https://github.com/twada/empower/releases/tag/v0.10.0) (2014-11-11) | ||
@@ -2,0 +11,0 @@ |
@@ -11,2 +11,3 @@ var gulp = require('gulp'), | ||
derequire = require('gulp-derequire'), | ||
dereserve = require('gulp-dereserve'), | ||
config = { | ||
@@ -108,5 +109,7 @@ bundle: { | ||
gulp.task('bundle', ['clean_bundle'], function() { | ||
var bundleStream = browserify({entries: config.bundle.srcFile, standalone: config.bundle.standalone}).bundle(); | ||
var b = browserify({entries: config.bundle.srcFile, standalone: config.bundle.standalone}); | ||
var bundleStream = b.bundle(); | ||
return bundleStream | ||
.pipe(source(config.bundle.destName)) | ||
.pipe(dereserve()) | ||
.pipe(derequire()) | ||
@@ -113,0 +116,0 @@ .pipe(gulp.dest(config.bundle.destDir)); |
@@ -6,3 +6,3 @@ /** | ||
* | ||
* Copyright (c) 2013-2014 Takuto Wada | ||
* Copyright (c) 2013-2015 Takuto Wada | ||
* Licensed under the MIT license. | ||
@@ -9,0 +9,0 @@ * https://github.com/twada/empower/blob/master/MIT-LICENSE.txt |
@@ -1,2 +0,2 @@ | ||
Copyright (c) 2013-2014 Takuto Wada, https://github.com/twada/empower | ||
Copyright (c) 2013-2015 Takuto Wada, https://github.com/twada/empower | ||
@@ -3,0 +3,0 @@ Permission is hereby granted, free of charge, to any person obtaining |
{ | ||
"name": "empower", | ||
"description": "Power Assert feature enhancer for assert function/object", | ||
"version": "0.10.0", | ||
"version": "0.11.0", | ||
"author": { | ||
@@ -14,21 +14,24 @@ "name": "Takuto Wada", | ||
"dependencies": { | ||
"escallmatch": "~1.0.0", | ||
"xtend": "~4.0.0" | ||
"escallmatch": "^1.3.1", | ||
"xtend": "^4.0.0" | ||
}, | ||
"devDependencies": { | ||
"blanket": "~1.1.6", | ||
"browserify": "~6.2.0", | ||
"buster-assertions": "~0.10.4", | ||
"del": "~0.1.3", | ||
"espower-source": "~0.10.0", | ||
"gulp": "~3.8.10", | ||
"gulp-derequire": "~2.0.0", | ||
"gulp-mocha": "~1.1.1", | ||
"gulp-mocha-phantomjs": "~0.5.1", | ||
"gulp-util": "~3.0.1", | ||
"gulp-webserver": "~0.8.3", | ||
"mocha": "~2.0.1", | ||
"mocha-lcov-reporter": "~0.0.1", | ||
"through2": "~1.1.1", | ||
"vinyl-source-stream": "~1.0.0" | ||
"acorn": "^1.0.3", | ||
"blanket": "^1.1.6", | ||
"browserify": "^9.0.8", | ||
"buster-assertions": "^0.10.4", | ||
"del": "^1.1.1", | ||
"escodegen": "^1.6.1", | ||
"espower": "^0.11.0", | ||
"gulp": "^3.8.11", | ||
"gulp-derequire": "^2.0.0", | ||
"gulp-dereserve": "^0.2.0", | ||
"gulp-mocha": "^2.0.1", | ||
"gulp-mocha-phantomjs": "^0.6.1", | ||
"gulp-util": "^3.0.4", | ||
"gulp-webserver": "^0.9.0", | ||
"mocha": "^2.2.4", | ||
"mocha-lcov-reporter": "^0.0.2", | ||
"through2": "^1.1.1", | ||
"vinyl-source-stream": "^1.1.0" | ||
}, | ||
@@ -45,2 +48,3 @@ "directories": { | ||
"lib", | ||
"build/empower.js", | ||
"package.json", | ||
@@ -69,4 +73,5 @@ "test" | ||
"test": "gulp test", | ||
"unit": "gulp unit", | ||
"coveralls": "gulp coverage && cat ./coverage.lcov | coveralls" | ||
} | ||
} |
empower | ||
================================ | ||
[![Build Status](https://travis-ci.org/twada/empower.svg?branch=master)](https://travis-ci.org/twada/empower) | ||
[![NPM version](https://badge.fury.io/js/empower.svg)](http://badge.fury.io/js/empower) | ||
[![Dependency Status](https://gemnasium.com/twada/empower.svg)](https://gemnasium.com/twada/empower) | ||
[![Coverage Status](https://coveralls.io/repos/twada/empower/badge.png?branch=master)](https://coveralls.io/r/twada/empower?branch=master) | ||
[![Code Climate](https://codeclimate.com/github/twada/empower/badges/gpa.svg)](https://codeclimate.com/github/twada/empower) | ||
[![License](http://img.shields.io/badge/license-MIT-brightgreen.svg)](https://github.com/twada/empower/blob/master/MIT-LICENSE.txt) | ||
[![Built with Gulp](http://img.shields.io/badge/built_with-gulp-brightgreen.svg)](http://gulpjs.com/) | ||
[![Build Status][travis-image]][travis-url] | ||
[![NPM package][npm-image]][npm-url] | ||
[![Bower package][bower-image]][bower-url] | ||
[![Dependency Status][depstat-image]][depstat-url] | ||
[![Coverage Status][coverage-image]][coverage-url] | ||
[![Code Climate][codeclimate-image]][codeclimate-url] | ||
[![License][license-image]][license-url] | ||
[![Built with Gulp][gulp-image]][gulp-url] | ||
@@ -181,2 +182,9 @@ | ||
#### use empower npm module on browser | ||
`empower` function is exported | ||
<script type="text/javascript" src="./path/to/node_modules/empower/build/empower.js"></script> | ||
### via bower | ||
@@ -201,1 +209,26 @@ | ||
Licensed under the [MIT](https://github.com/twada/empower/blob/master/MIT-LICENSE.txt) license. | ||
[npm-url]: https://npmjs.org/package/empower | ||
[npm-image]: https://badge.fury.io/js/empower.svg | ||
[bower-url]: http://badge.fury.io/bo/empower | ||
[bower-image]: https://badge.fury.io/bo/empower.svg | ||
[travis-url]: http://travis-ci.org/twada/empower | ||
[travis-image]: https://secure.travis-ci.org/twada/empower.svg?branch=master | ||
[depstat-url]: https://gemnasium.com/twada/empower | ||
[depstat-image]: https://gemnasium.com/twada/empower.svg | ||
[license-url]: https://github.com/twada/empower/blob/master/MIT-LICENSE.txt | ||
[license-image]: http://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat | ||
[codeclimate-url]: https://codeclimate.com/github/twada/empower | ||
[codeclimate-image]: https://codeclimate.com/github/twada/empower/badges/gpa.svg | ||
[coverage-url]: https://coveralls.io/r/twada/empower?branch=master | ||
[coverage-image]: https://coveralls.io/repos/twada/empower/badge.svg?branch=master | ||
[gulp-url]: http://gulpjs.com/ | ||
[gulp-image]: http://img.shields.io/badge/built_with-gulp-brightgreen.svg |
(function (root, factory) { | ||
'use strict'; | ||
if (typeof define === 'function' && define.amd) { | ||
define(['empower', 'espower-source', 'assert', 'buster-assertions'], factory); | ||
define(['empower', 'espower', 'acorn', 'escodegen', 'assert', 'buster-assertions'], factory); | ||
} else if (typeof exports === 'object') { | ||
factory(require('..'), require('espower-source'), require('assert'), require('buster-assertions')); | ||
factory(require('..'), require('espower'), require('acorn'), require('escodegen'), require('assert'), require('buster-assertions')); | ||
} else { | ||
factory(root.empower, root.espowerSource, root.assert, root.buster); | ||
factory(root.empower, root.espower, root.acorn, root.escodegen, root.assert, root.buster); | ||
} | ||
}(this, function ( | ||
empower, | ||
espowerSource, | ||
espower, | ||
acorn, | ||
escodegen, | ||
baseAssert, | ||
busterAssertions | ||
) { | ||
// see: https://github.com/Constellation/escodegen/issues/115 | ||
if (typeof define === 'function' && define.amd) { | ||
escodegen = window.escodegen; | ||
} | ||
var weave = function (line) { | ||
var options = { | ||
destructive: false, | ||
path: '/path/to/some_test.js', | ||
var filepath = '/path/to/some_test.js'; | ||
var espowerOptions = { | ||
source: line, | ||
path: filepath, | ||
destructive: true, | ||
patterns: [ | ||
@@ -27,3 +37,5 @@ 'assert(actual, [message])', | ||
}; | ||
return espowerSource(line, '/path/to/some_test.js', options); | ||
var jsAST = acorn.parse(line, {ecmaVersion: 6, locations: true, sourceType: 'module', sourceFile: filepath}); | ||
var espoweredAST = espower(jsAST, espowerOptions); | ||
return escodegen.generate(espoweredAST, {format: {compact: true}}); | ||
}, | ||
@@ -57,3 +69,2 @@ fakeFormatter = function (context) { | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, [ | ||
@@ -64,2 +75,3 @@ '/path/to/some_test.js', | ||
].join('\n')); | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -76,3 +88,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, [ | ||
@@ -83,2 +94,3 @@ '[assert.isNull] /path/to/some_test.js', | ||
].join('\n')); | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -96,3 +108,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, [ | ||
@@ -103,2 +114,3 @@ '[assert.same] /path/to/some_test.js', | ||
].join('\n')); | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -113,3 +125,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, [ | ||
@@ -120,2 +131,3 @@ '[assert.same] /path/to/some_test.js', | ||
].join('\n')); | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -130,3 +142,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, [ | ||
@@ -137,2 +148,3 @@ '[assert.same] /path/to/some_test.js', | ||
].join('\n')); | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -150,3 +162,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, [ | ||
@@ -157,2 +168,3 @@ '[assert.near] /path/to/some_test.js', | ||
].join('\n')); | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -167,3 +179,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, [ | ||
@@ -174,2 +185,3 @@ '[assert.near] not in delta /path/to/some_test.js', | ||
].join('\n')); | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -176,0 +188,0 @@ }); |
(function (root, factory) { | ||
'use strict'; | ||
if (typeof define === 'function' && define.amd) { | ||
define(['empower', 'espower-source', 'assert'], factory); | ||
define(['empower', 'espower', 'acorn', 'escodegen', 'assert'], factory); | ||
} else if (typeof exports === 'object') { | ||
factory(require('..'), require('espower-source'), require('assert')); | ||
factory(require('..'), require('espower'), require('acorn'), require('escodegen'), require('assert')); | ||
} else { | ||
factory(root.empower, root.espowerSource, root.assert); | ||
factory(root.empower, root.espower, root.acorn, root.escodegen, root.assert); | ||
} | ||
}(this, function ( | ||
empower, | ||
espowerSource, | ||
espower, | ||
acorn, | ||
escodegen, | ||
baseAssert | ||
) { | ||
var weave = function (line) { | ||
return espowerSource(line, '/path/to/some_test.js'); | ||
// see: https://github.com/Constellation/escodegen/issues/115 | ||
if (typeof define === 'function' && define.amd) { | ||
escodegen = window.escodegen; | ||
} | ||
var weave = function (line, patterns) { | ||
var filepath = '/path/to/some_test.js'; | ||
var espowerOptions = { | ||
source: line, | ||
path: filepath, | ||
destructive: true | ||
}; | ||
if (patterns) { | ||
espowerOptions.patterns = patterns; | ||
} | ||
var jsAST = acorn.parse(line, {ecmaVersion: 6, locations: true, sourceType: 'module', sourceFile: filepath}); | ||
var espoweredAST = espower(jsAST, espowerOptions); | ||
return escodegen.generate(espoweredAST, {format: {compact: true}}); | ||
}, | ||
@@ -31,5 +50,2 @@ fakeFormatter = function (context) { | ||
test('default options behavior', function () { | ||
var weave = function (line) { | ||
return espowerSource(line, '/path/to/some_test.js'); | ||
}; | ||
var assert = empower(baseAssert, fakeFormatter); | ||
@@ -42,3 +58,2 @@ | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, [ | ||
@@ -49,2 +64,3 @@ '/path/to/some_test.js', | ||
].join('\n')); | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -64,3 +80,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
if (option.modifyMessageOnRethrow) { | ||
@@ -88,2 +103,3 @@ baseAssert.equal(e.message, [ | ||
} | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -99,3 +115,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
if (option.modifyMessageOnRethrow) { | ||
@@ -125,2 +140,3 @@ baseAssert.equal(e.message, [ | ||
} | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -136,3 +152,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
if (option.modifyMessageOnRethrow) { | ||
@@ -162,2 +177,3 @@ baseAssert.equal(e.message, [ | ||
} | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -174,3 +190,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
if (option.modifyMessageOnRethrow) { | ||
@@ -200,2 +215,3 @@ baseAssert.equal(e.message, [ | ||
} | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -213,3 +229,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
if (option.modifyMessageOnRethrow) { | ||
@@ -241,2 +256,3 @@ baseAssert.equal(e.message, [ | ||
} | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -251,3 +267,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
if (option.modifyMessageOnRethrow) { | ||
@@ -275,2 +290,3 @@ baseAssert.equal(e.message, [ | ||
} | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -285,3 +301,2 @@ }); | ||
} catch (e) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
if (option.modifyMessageOnRethrow) { | ||
@@ -309,2 +324,3 @@ baseAssert.equal(e.message, [ | ||
} | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
} | ||
@@ -348,5 +364,2 @@ }); | ||
]; | ||
var weave = function (line) { | ||
return espowerSource(line, '/path/to/some_test.js', { patterns: patterns }); | ||
}; | ||
var assert = empower(baseAssert, fakeFormatter, { patterns: patterns }); | ||
@@ -356,7 +369,7 @@ | ||
try { | ||
eval(weave('assert(falsy);')); | ||
eval(weave('assert(falsy);', patterns)); | ||
baseAssert.ok(false, 'AssertionError should be thrown'); | ||
} catch (e) { | ||
baseAssert.equal(e.message, '0 == true', 'should not be empowered'); | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, '0 == true', 'should not be empowered'); | ||
} | ||
@@ -363,0 +376,0 @@ }); |
@@ -31,3 +31,3 @@ (function (root, factory) { | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, '"foo" == null'); | ||
baseAssert((e.message === '\'foo\' == null' || e.message === '\"foo\" == null')); | ||
baseAssert(e.powerAssertContext === undefined); | ||
@@ -74,3 +74,3 @@ } | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, '"foo" == "bar"'); | ||
baseAssert((e.message === '\'foo\' == \'bar\'' || e.message === '\"foo\" == \"bar\"')); | ||
baseAssert(e.powerAssertContext === undefined); | ||
@@ -87,3 +87,3 @@ } | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, '"foo" == "bar"'); | ||
baseAssert((e.message === '\'foo\' == \'bar\'' || e.message === '\"foo\" == \"bar\"')); | ||
baseAssert(e.powerAssertContext === undefined); | ||
@@ -100,3 +100,3 @@ } | ||
baseAssert.equal(e.name, 'AssertionError'); | ||
baseAssert.equal(e.message, '"foo" == "bar"'); | ||
baseAssert((e.message === '\'foo\' == \'bar\'' || e.message === '\"foo\" == \"bar\"')); | ||
baseAssert(e.powerAssertContext === undefined); | ||
@@ -103,0 +103,0 @@ } |
var require = { | ||
paths: { | ||
empower: "../build/empower", | ||
"espower-source": "../bower_components/espower-source/build/espower-source", | ||
acorn: '../node_modules/acorn/dist/acorn', | ||
escodegen: '../bower_components/escodegen/escodegen.browser', | ||
espower: "../node_modules/espower/build/espower", | ||
assert: "../bower_components/assert/assert", | ||
@@ -6,0 +8,0 @@ mocha: "../bower_components/mocha/mocha", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
High entropy strings
Supply chain riskContains high entropy strings. This could be a sign of encrypted data, leaked secrets or obfuscated code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
300511
18
7521
233
18
5
23
+ Addedcall-matcher@1.1.0(transitive)
+ Addedcore-js@2.6.12(transitive)
+ Addeddeep-equal@1.1.2(transitive)
+ Addedescallmatch@1.5.0(transitive)
+ Addedesprima@2.7.3(transitive)
+ Addedespurify@1.8.1(transitive)
+ Addedestraverse@4.3.0(transitive)
+ Addedis-arguments@1.1.1(transitive)
+ Addedobject-is@1.1.6(transitive)
- Removedarray-buffer-byte-length@1.0.1(transitive)
- Removedarraybuffer.prototype.slice@1.0.3(transitive)
- Removedavailable-typed-arrays@1.0.7(transitive)
- Removeddata-view-buffer@1.0.1(transitive)
- Removeddata-view-byte-length@1.0.1(transitive)
- Removeddata-view-byte-offset@1.0.0(transitive)
- Removeddeep-equal@0.2.2(transitive)
- Removedes-abstract@1.23.5(transitive)
- Removedes-object-atoms@1.0.0(transitive)
- Removedes-set-tostringtag@2.0.3(transitive)
- Removedes-to-primitive@1.2.1(transitive)
- Removedescallmatch@1.0.1(transitive)
- Removedesprima@1.2.5(transitive)
- Removedespurify@1.0.1(transitive)
- Removedestraverse@1.8.0(transitive)
- Removedfor-each@0.3.3(transitive)
- Removedfunction.prototype.name@1.1.6(transitive)
- Removedget-symbol-description@1.0.2(transitive)
- Removedglobalthis@1.0.4(transitive)
- Removedhas-bigints@1.0.2(transitive)
- Removedindexof@0.0.1(transitive)
- Removedinternal-slot@1.0.7(transitive)
- Removedis-array-buffer@3.0.4(transitive)
- Removedis-bigint@1.0.4(transitive)
- Removedis-boolean-object@1.1.2(transitive)
- Removedis-callable@1.2.7(transitive)
- Removedis-data-view@1.0.1(transitive)
- Removedis-negative-zero@2.0.3(transitive)
- Removedis-number-object@1.0.7(transitive)
- Removedis-shared-array-buffer@1.0.3(transitive)
- Removedis-string@1.0.7(transitive)
- Removedis-symbol@1.0.4(transitive)
- Removedis-typed-array@1.1.13(transitive)
- Removedis-weakref@1.0.2(transitive)
- Removedisarray@2.0.5(transitive)
- Removedobject-inspect@1.13.3(transitive)
- Removedobject.assign@4.1.5(transitive)
- Removedpossible-typed-array-names@1.0.0(transitive)
- Removedsafe-array-concat@1.1.2(transitive)
- Removedsafe-regex-test@1.0.3(transitive)
- Removedside-channel@1.0.6(transitive)
- Removedstring.prototype.trim@1.2.9(transitive)
- Removedstring.prototype.trimend@1.0.8(transitive)
- Removedstring.prototype.trimstart@1.0.8(transitive)
- Removedtraverse@0.6.10(transitive)
- Removedtyped-array-buffer@1.0.2(transitive)
- Removedtyped-array-byte-length@1.0.1(transitive)
- Removedtyped-array-byte-offset@1.0.2(transitive)
- Removedtyped-array-length@1.0.6(transitive)
- Removedtypedarray.prototype.slice@1.0.3(transitive)
- Removedunbox-primitive@1.0.2(transitive)
- Removedwhich-boxed-primitive@1.0.2(transitive)
- Removedwhich-typed-array@1.1.15(transitive)
Updatedescallmatch@^1.3.1
Updatedxtend@^4.0.0