mirror of
https://github.com/titanscouting/tra-analysis.git
synced 2025-11-05 23:06:51 +00:00
push all website files
This commit is contained in:
343
website/functions/node_modules/power-assert/CHANGELOG.md
generated
vendored
Normal file
343
website/functions/node_modules/power-assert/CHANGELOG.md
generated
vendored
Normal file
@@ -0,0 +1,343 @@
|
||||
### [1.6.1](https://github.com/power-assert-js/power-assert/releases/tag/v1.6.1) (2018-09-08)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* update [empower to 1.3.1](https://github.com/power-assert-js/empower/pull/29) to work well with Jest
|
||||
|
||||
|
||||
## [1.6.0](https://github.com/power-assert-js/power-assert/releases/tag/v1.6.0) (2018-06-14)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* [Support ES2018 syntax](https://github.com/power-assert-js/power-assert/pull/109)
|
||||
|
||||
|
||||
## [1.5.0](https://github.com/power-assert-js/power-assert/releases/tag/v1.5.0) (2018-03-30)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* [support "Strict mode" introduced in Node9](https://github.com/power-assert-js/power-assert/pull/104)
|
||||
|
||||
|
||||
### [1.4.4](https://github.com/power-assert-js/power-assert/releases/tag/v1.4.4) (2017-06-10)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* [Update empower to 1.2.3 for vanilla Node8 support](https://github.com/power-assert-js/power-assert/pull/90)
|
||||
|
||||
|
||||
### [1.4.3](https://github.com/power-assert-js/power-assert/releases/tag/v1.4.3) (2017-06-04)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* [Update empower to 1.2.2 for Node v8 support](https://github.com/power-assert-js/power-assert/pull/86)
|
||||
|
||||
|
||||
### [1.4.2](https://github.com/power-assert-js/power-assert/releases/tag/v1.4.2) (2016-11-11)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* [Fix deepStrictEqual usage to run with old Node (v0.12)](https://github.com/power-assert-js/power-assert/pull/71)
|
||||
|
||||
|
||||
### [1.4.1](https://github.com/power-assert-js/power-assert/releases/tag/v1.4.1) (2016-05-10)
|
||||
|
||||
* update [universal-deep-strict-equal](https://github.com/twada/universal-deep-strict-equal) to 1.2.1 ([70bc3fb9](https://github.com/power-assert-js/power-assert/commit/70bc3fb91eaee7271d7be111b3461a7dc3638045))
|
||||
|
||||
|
||||
## [1.4.0](https://github.com/power-assert-js/power-assert/releases/tag/v1.4.0) (2016-05-06)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* [Integrate universal-deep-strict-equal to enable `deepStrictEqual` on browsers](https://github.com/power-assert-js/power-assert/pull/54)
|
||||
|
||||
|
||||
### [1.3.1](https://github.com/power-assert-js/power-assert/releases/tag/v1.3.1) (2016-03-10)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* [Access property `default` using bracket notation](https://github.com/power-assert-js/power-assert/pull/40) by [@LeshaKoss](https://github.com/LeshaKoss), since using dot notation to access the property `default` causes an error in Internet Explorer 8.
|
||||
|
||||
|
||||
## [1.3.0](https://github.com/power-assert-js/power-assert/releases/tag/v1.3.0) (2016-03-09)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* Module style interop. [Support standard style definitions of transpirable es6 modules](https://github.com/power-assert-js/power-assert/pull/37) by [@falsandtru](https://github.com/falsandtru)
|
||||
|
||||
refs: [Babel and CommonJS modules](http://www.2ality.com/2015/12/babel-commonjs.html)
|
||||
|
||||
|
||||
## [1.2.0](https://github.com/power-assert-js/power-assert/releases/tag/v1.2.0) (2015-11-14)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* [support async/await](https://github.com/power-assert-js/power-assert-formatter/pull/20) (by [@jamestalmage](https://github.com/jamestalmage))
|
||||
* [support yield expressions](https://github.com/power-assert-js/power-assert-formatter/pull/19) (by [@jamestalmage](https://github.com/jamestalmage))
|
||||
|
||||
|
||||
## [1.1.0](https://github.com/power-assert-js/power-assert/releases/tag/v1.1.0) (2015-10-04)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* [Support `import from` syntax of ES6 module](https://github.com/power-assert-js/power-assert/pull/28) by [@falsandtru](https://github.com/falsandtru)
|
||||
|
||||
|
||||
### [1.0.1](https://github.com/power-assert-js/power-assert/releases/tag/v1.0.1) (2015-09-14)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* update empower and power-assert-formatter ([f118c4f](https://github.com/power-assert-js/power-assert/commit/f118c4f74a130a4adfd8014a10a707ac36381289)) to [fix location detection of infix operator](https://github.com/power-assert-js/power-assert-formatter/commit/f6e0d6919ee32045c18983c00d60011d0dc4a0d1)
|
||||
|
||||
|
||||
## [1.0.0](https://github.com/power-assert-js/power-assert/releases/tag/v1.0.0) (2015-08-26)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* upgrade power-assert-formatter for native ES6 Symbol support ([d8ba0a1b](https://github.com/power-assert-js/power-assert/commit/d8ba0a1bb6809fecd4900af6ade1213ad58f5db0))
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* transfer to power-assert-js organization ([64b2fe2e](https://github.com/power-assert-js/power-assert/commit/64b2fe2ea510ba06088d2f07531370af63f195e2))
|
||||
* [official logo!](https://github.com/power-assert-js/power-assert-js-logo)
|
||||
|
||||
|
||||
## [0.11.0](https://github.com/power-assert-js/power-assert/releases/tag/v0.11.0) (2015-04-18)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* [ES6 support](https://github.com/power-assert-js/power-assert/pull/17)
|
||||
|
||||
|
||||
### [0.10.2](https://github.com/power-assert-js/power-assert/releases/tag/v0.10.2) (2015-02-16)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* **power-assert:**
|
||||
* update power-assert-formatter to 0.10.2 ([2c0f9624](https://github.com/power-assert-js/power-assert/commit/2c0f962415d60e59affb8f009ae4822f7b503c92)) to apply [stringifier fix]([67a9fa72](https://github.com/twada/stringifier/commit/67a9fa725c7602f948772f4f5f5a74806809ee34))
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* **power-assert:**
|
||||
* ship npm module with built bundle for browsers ([431769f3](https://github.com/power-assert-js/power-assert/commit/431769f3d5da68c279ebf59b0cfd1231fa385361))
|
||||
* add Node 0.12 and io.js to Travis build ([dd9629f9](https://github.com/power-assert-js/power-assert/commit/dd9629f96f3a204f6c24156f648b172f7c6abd4c))
|
||||
|
||||
|
||||
### [0.10.1](https://github.com/power-assert-js/power-assert/releases/tag/v0.10.1) (2015-01-09)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* **power-assert:**
|
||||
* apply [assert.deepEqual fix](https://github.com/substack/node-browserify/pull/1041) in browserify 8.1.0 ([96302406](https://github.com/power-assert-js/power-assert/commit/963024062e6c144f2d5487d788e883f418a9c746))
|
||||
* apply [dereserve](https://github.com/twada/dereserve) to browser build
|
||||
|
||||
|
||||
## [0.10.0](https://github.com/power-assert-js/power-assert/releases/tag/v0.10.0) (2014-11-12)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* **power-assert:**
|
||||
* [provide API for customization](https://github.com/power-assert-js/power-assert/pull/14) (see [CUSTOMIZATION API](https://github.com/power-assert-js/power-assert#customization-api))
|
||||
|
||||
* **power-assert-formatter:**
|
||||
* [diff option to make string diff function pluggable](https://github.com/power-assert-js/power-assert-formatter/pull/11) (new option [options.diff](https://github.com/power-assert-js/power-assert-formatter#optionsdiff))
|
||||
* [outputOffset option to configure number of spaces inserted at the left](https://github.com/power-assert-js/power-assert-formatter/pull/12) (new option [options.outputOffset](https://github.com/power-assert-js/power-assert-formatter#optionsoutputoffset))
|
||||
* [ambiguousEastAsianCharWidth option to make ambiguous east asian character width configurable](https://github.com/power-assert-js/power-assert-formatter/pull/13) (new option [options.ambiguousEastAsianCharWidth](https://github.com/power-assert-js/power-assert-formatter#optionsambiguouseastasiancharwidth))
|
||||
|
||||
* **espowerify:**
|
||||
* [transform file if and only if it is listed in browserify entries](https://github.com/power-assert-js/espowerify/pull/5)
|
||||
|
||||
|
||||
### 0.9.1 (2014-10-08)
|
||||
|
||||
|
||||
#### Bug Fixes
|
||||
|
||||
* **empower:**
|
||||
* power-assert output doesn't appear in Node 0.11.x ([53e882e0](https://github.com/power-assert-js/empower/commit/53e882e00ad3dd8b45f262ab14ac782ed582b954))
|
||||
|
||||
|
||||
## 0.9.0 (2014-09-02)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
Now power-assert 0.9.0 supports multi-stage sourcemaps.
|
||||
|
||||
* **power-assert:**
|
||||
* update empower and power-assert-formatter to 0.9.0 ([a84ca4e1](https://github.com/power-assert-js/power-assert/commit/a84ca4e1e67e6146452622743915bd78a5f417d0))
|
||||
|
||||
* **empower:**
|
||||
* There's no significant changes
|
||||
|
||||
* **power-assert-formatter:**
|
||||
* [Customizable Renderers](https://github.com/power-assert-js/power-assert-formatter/pull/10)
|
||||
* move built-in renderers to ./built-in/ ([acf85109](https://github.com/power-assert-js/power-assert-formatter/commit/acf85109bcb579109b80a36a8a6439c4e028066d))
|
||||
* customize rendering by using custom renderer constructor in `renderers` option ([265d3539](https://github.com/power-assert-js/power-assert-formatter/commit/265d353997f7321e9e24c5252c7aa0f4c696624a))
|
||||
* use EventEmitter to make renderers customizable ([7c190e11](https://github.com/power-assert-js/power-assert-formatter/commit/7c190e1170de8c96129a2ccd3e67fd9f14623732))
|
||||
|
||||
* **espower:**
|
||||
* [SourceMap support](https://github.com/power-assert-js/espower/pull/11)
|
||||
* adjust filepath in power-assert output if sourceMap option is given ([f919d59d](https://github.com/power-assert-js/espower/commit/f919d59d6eea764881e0266f562724b7142f7695))
|
||||
* adjust line number in power-assert output if sourceMap option is given ([8c035d89](https://github.com/power-assert-js/espower/commit/8c035d89ae88c8554cb8ca0b6bd0f7d6fe2008b0))
|
||||
|
||||
* **espower-source:**
|
||||
* backport espowerify to support multi-stage sourcemaps ([71de737c](https://github.com/power-assert-js/espower-source/commit/71de737cb16231db852a44592e896a43c447298b))
|
||||
|
||||
* **espower-loader:**
|
||||
* use espower-source 0.9.0 ([c5329f39](https://github.com/power-assert-js/espower-loader/commit/c5329f397d4ab8e434a1788d0fa1c2eb7670a25c))
|
||||
|
||||
* **grunt-espower:**
|
||||
* [support multistage sourcemap by @vvakame](https://github.com/power-assert-js/grunt-espower/pull/2)
|
||||
* Thanks @vvakame for the great contribution!
|
||||
|
||||
* **gulp-espower:**
|
||||
* [support gulp-sourcemaps](https://github.com/power-assert-js/gulp-espower/pull/2)
|
||||
|
||||
* **espowerify:**
|
||||
* use espower-source directly since espower-source 0.9.0 is backported from espowerify ([625cf55d](https://github.com/power-assert-js/espowerify/commit/625cf55d5b73893f4babd00c07489590ef786be0))
|
||||
* use multi-stage-sourcemap module to generate more accurate sourcemaps ([b1f939fa](https://github.com/power-assert-js/espowerify/commit/b1f939faa84be7f4fde82313b2257042b336d25c))
|
||||
* if upstream SourceMap is given, decode and offset it ([a1683475](https://github.com/power-assert-js/espowerify/commit/a1683475a588b0a5b0aee040f23dfb04ad902b11))
|
||||
|
||||
* **espower-coffee:**
|
||||
* interact with coffeescript compiler to adjust line number in power-assert output ([9c159205](https://github.com/power-assert-js/espower-coffee/commit/9c159205608e6a556f61167d1fb65123ae2421ab))
|
||||
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
**No change is required if you are using default configuration.**
|
||||
|
||||
* **power-assert-formatter:**
|
||||
* built-in renderers are listed as relative path
|
||||
|
||||
If you are customizing renderers by `options.renderers`, you may have to migrate.
|
||||
|
||||
To migrate, change your code from the following:
|
||||
|
||||
```
|
||||
[
|
||||
'file',
|
||||
'assertion',
|
||||
'diagram',
|
||||
'binary-expression'
|
||||
]
|
||||
```
|
||||
|
||||
To:
|
||||
|
||||
```
|
||||
[
|
||||
'./built-in/file',
|
||||
'./built-in/assertion',
|
||||
'./built-in/diagram',
|
||||
'./built-in/binary-expression'
|
||||
]
|
||||
```
|
||||
|
||||
([265d3539](https://github.com/power-assert-js/power-assert-formatter/commit/265d353997f7321e9e24c5252c7aa0f4c696624a)), ([acf85109](https://github.com/power-assert-js/power-assert-formatter/commit/acf85109bcb579109b80a36a8a6439c4e028066d))
|
||||
|
||||
|
||||
## 0.8.0 (2014-08-12)
|
||||
|
||||
|
||||
#### Features
|
||||
|
||||
* **power-assert:**
|
||||
* use single index.js ([e8fa666a](https://github.com/power-assert-js/power-assert/commit/e8fa666aa8197747ae56ca1a55fb171d30d7534c))
|
||||
* update empower and power-assert-formatter to 0.8.0 ([8f760aa0](https://github.com/power-assert-js/power-assert/commit/8f760aa07271f3bcd52576dc503f3d301d67110c))
|
||||
|
||||
* **empower:**
|
||||
* [built and modularized by browserify](https://github.com/power-assert-js/empower/pull/12)
|
||||
* use `escallmatch` module to describe target patterns ([533a21a0](https://github.com/power-assert-js/empower/commit/533a21a0374f23f5ca4e198c17d1e20f10d705fa))
|
||||
* support assertion methods with three or more arguments ([d31dca86](https://github.com/power-assert-js/empower/commit/d31dca86de2b05ee88ca5df15579308368657d43))
|
||||
* if not in patterns, do not empower assertion function itself ([1d73a756](https://github.com/power-assert-js/empower/commit/1d73a7560ef586a45a0a9259e57c143b3b60caaa))
|
||||
* option `targetMethods` does not required any more ([8ffcc49f](https://github.com/power-assert-js/empower/commit/8ffcc49fcdb5523eb38e63a0e7cca34f752d9302))
|
||||
* rename `saveContextOnFail` option to `saveContextOnRethrow` ([1f6133b2](https://github.com/power-assert-js/empower/commit/1f6133b24be672f32cfd3b66522a7d14ca5d22e1))
|
||||
* rename `modifyMessageOnFail` option to `modifyMessageOnRethrow` ([0c8a88f0](https://github.com/power-assert-js/empower/commit/0c8a88f0592917ba15ac0c1bf21c8f39f39ab350))
|
||||
|
||||
* **power-assert-formatter:**
|
||||
* [built and modularized by browserify](https://github.com/power-assert-js/power-assert-formatter/pull/8)
|
||||
* [use spun-off stringifier module](https://github.com/power-assert-js/power-assert-formatter/pull/9)
|
||||
|
||||
* **espower:**
|
||||
* [built and modularized by browserify](https://github.com/power-assert-js/espower/pull/9)
|
||||
* [use escallmatch module to describe instrumentation target patterns](https://github.com/power-assert-js/espower/pull/10)
|
||||
* support chained callee like `browser.assert.element(selector)` ([ea0a3ce9](https://github.com/power-assert-js/espower/commit/ea0a3ce96f56034ab6735365184e1e397f6561c0))
|
||||
|
||||
* **espower-source:**
|
||||
* update espower to 0.8.0 ([ae15a229](https://github.com/power-assert-js/espower-source/commit/ae15a229367c65a7a590104f3fb0fc0b2a7582d0))
|
||||
* simple xtend would be better for options handling ([6bea0a92](https://github.com/power-assert-js/espower-source/commit/6bea0a9241aba71f2dcae9c285561e68d91531bb))
|
||||
|
||||
* **espower-loader:**
|
||||
* update espower-source to 0.8.0 ([54c2143b](https://github.com/power-assert-js/espower-loader/commit/54c2143bba3966aaf61f1a4d331f3543257f9222))
|
||||
|
||||
* **grunt-espower:**
|
||||
* update espower-source to 0.8.0 ([55110fa4](https://github.com/power-assert-js/grunt-espower/commit/55110fa4bffab62045d207d0460eaa864cc9fa8e))
|
||||
|
||||
* **gulp-espower:**
|
||||
* update espower-source to 0.8.0 ([a9ab1f7d](https://github.com/power-assert-js/gulp-espower/commit/a9ab1f7de7275b717589bd8eb8048b89bc575763))
|
||||
* now supports streams as well ([ada19f90](https://github.com/power-assert-js/gulp-espower/commit/ada19f90f0dfc674405342310259e31ddd3a6dd0))
|
||||
|
||||
* **espowerify:**
|
||||
* update espower-source to 0.8.0 ([026bd0c6](https://github.com/power-assert-js/espowerify/commit/026bd0c6e2d1200084051612dc262ab5509a5652))
|
||||
|
||||
* **espower-coffee:**
|
||||
* update espower-source to 0.8.0 ([8702d847](https://github.com/power-assert-js/espower-coffee/commit/8702d84704d659919e96801014c4653539b7b3f0))
|
||||
* [now in beta stage](https://github.com/power-assert-js/espower-coffee/commit/a357b3d35460b9abd17517375d737a8a0bce98dd)
|
||||
|
||||
|
||||
#### Breaking Changes
|
||||
|
||||
First of all, **No change is required if you are using default configuration.**
|
||||
|
||||
* **instrumentors:**
|
||||
|
||||
Version 0.8.0 introduces [escallmatch](https://github.com/twada/escallmatch) syntax for configuration.
|
||||
|
||||
If you are:
|
||||
* using instrumentors such as `espower-loader`, `grunt-espower`, `gulp-espower`, `espowerify` and `espower-coffee`
|
||||
* or using `espower-source` or `espower` directly
|
||||
|
||||
And
|
||||
|
||||
* having custom instrumentation pattern using `powerAssertVariableName` or `targetMethods` property
|
||||
|
||||
Then you need to migarte. To migrate, please see CHANGELOG for the instrumentor you choose.
|
||||
|
||||
* [espower-loader CHANGELOG](https://github.com/power-assert-js/espower-loader/blob/master/CHANGELOG.md)
|
||||
* [grunt-espower CHANGELOG](https://github.com/power-assert-js/grunt-espower/blob/master/CHANGELOG.md)
|
||||
* [gulp-espower CHANGELOG](https://github.com/power-assert-js/gulp-espower/blob/master/CHANGELOG.md)
|
||||
* [espowerify CHANGELOG](https://github.com/power-assert-js/espowerify/blob/master/CHANGELOG.md)
|
||||
* [espower-coffee CHANGELOG](https://github.com/power-assert-js/espower-coffee/blob/master/CHANGELOG.md)
|
||||
* [espower-source CHANGELOG](https://github.com/power-assert-js/espower-source/blob/master/CHANGELOG.md)
|
||||
* [espower CHANGELOG](https://github.com/power-assert-js/espower/blob/master/CHANGELOG.md)
|
||||
|
||||
|
||||
* **empower:**
|
||||
* `saveContextOnFail` option is renamed to `saveContextOnRethrow`
|
||||
* `modifyMessageOnFail` option is renamed to `modifyMessageOnRethrow`
|
||||
* option `targetMethods` does not required any more
|
||||
* Please see [empower CHANGELOG](https://github.com/power-assert-js/empower/blob/master/CHANGELOG.md) for more details.
|
||||
|
||||
* **power-assert-formatter:**
|
||||
* option `stringifyDepth` does not supported any more. use `maxDepth` option instead.
|
||||
* Please see [power-assert-formatter CHANGELOG](https://github.com/power-assert-js/power-assert-formatter/blob/master/CHANGELOG.md) for more details.
|
||||
20
website/functions/node_modules/power-assert/MIT-LICENSE.txt
generated
vendored
Normal file
20
website/functions/node_modules/power-assert/MIT-LICENSE.txt
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
Copyright (c) 2013-2018 Takuto Wada, https://github.com/power-assert-js/power-assert
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of this software and associated documentation files (the
|
||||
"Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish,
|
||||
distribute, sublicense, and/or sell copies of the Software, and to
|
||||
permit persons to whom the Software is furnished to do so, subject to
|
||||
the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be
|
||||
included in all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
||||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
||||
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
||||
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
||||
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
986
website/functions/node_modules/power-assert/README.md
generated
vendored
Normal file
986
website/functions/node_modules/power-assert/README.md
generated
vendored
Normal file
@@ -0,0 +1,986 @@
|
||||
[![power-assert][power-assert-banner]][power-assert-url]
|
||||
|
||||
Power Assert in JavaScript. Provides descriptive assertion messages through standard [assert](https://nodejs.org/api/assert.html) interface. No API is the best API.
|
||||
|
||||
[![Build Status][travis-image]][travis-url]
|
||||
[![NPM package][npm-image]][npm-url]
|
||||
[![Bower package][bower-image]][bower-url]
|
||||
[![Dependency Status][depstat-image]][depstat-url]
|
||||
[![License][license-image]][license-url]
|
||||
|
||||
|
||||
DESCRIPTION
|
||||
---------------------------------------
|
||||
|
||||
What is `power-assert`?
|
||||
|
||||
* is an implementation of "Power Assert" concept in JavaScript.
|
||||
* provides descriptive assertion messages through standard [assert](https://nodejs.org/api/assert.html) interface.
|
||||
* __No API is the best API__. With power-assert, __you don't need to learn many assertion library APIs__ (in most cases, all you need to remember is just an `assert(any_expression)` function)
|
||||
* __Stop memorizing tons of assertion APIs. Just create expressions that return a truthy value or not__ and power-assert will show it to you right on the screen as part of your failure message without you having to type in a message at all.
|
||||
* the core value of power-assert is absolute simplicity and stability. Especially, power-assert sticks to the simplest form of testing, `assert(any_expression)`.
|
||||
* see slides: ["power-assert, mechanism and philosophy"](https://www.slideshare.net/t_wada/power-assert-nodefest-2014) -- talk at NodeFest 2014.
|
||||
* __[NEW] Now you don't need `require('power-assert')` any more. Keep using `require('assert')`, and power-assert enhances them transparently.__ See slides: [From Library to Tool - power-assert as a General Purpose Assertion Enhancement Tool](https://speakerdeck.com/twada/from-library-to-tool-power-assert-as-a-general-purpose-assertion-enhancement-tool)
|
||||
* to gain power-assert output, __you need to transform your test code__ to produce power-assert output.
|
||||
* `power-assert - power = assert`. Without code transpilation, power-assert works just as normal `assert` does.
|
||||
* fully compatible with [assert](https://nodejs.org/api/assert.html). So you can stop using power-assert and back to assert easily.
|
||||
* has [online demo site](https://azu.github.io/power-assert-demo/).
|
||||
* works both on server side and browser side.
|
||||
* available via [npm](https://www.npmjs.com/package/power-assert) and [bower](https://bower.io/search/?q=power-assert).
|
||||
* supports sourcemaps so you can debug as usual.
|
||||
* provides [babel plugin](https://github.com/power-assert-js/babel-plugin-espower) and [babel preset](https://github.com/power-assert-js/babel-preset-power-assert).
|
||||
* provides [browserify transform](https://github.com/power-assert-js/espowerify).
|
||||
* provides [webpack loader](https://github.com/power-assert-js/webpack-espower-loader).
|
||||
* provides [grunt task](https://github.com/power-assert-js/grunt-espower) and [gulp plugin](https://github.com/power-assert-js/gulp-espower).
|
||||
* provides [command](https://github.com/power-assert-js/espower-cli).
|
||||
* provides [custom module loader](https://github.com/power-assert-js/espower-loader) and its [convenient config module](https://github.com/power-assert-js/intelli-espower-loader).
|
||||
* provides [Karma Adapter](https://github.com/power-assert-js/karma-power-assert) and [Karma Preprocessor](https://github.com/power-assert-js/karma-espower-preprocessor).
|
||||
* supports ES6+ through [babel plugin](https://github.com/power-assert-js/babel-plugin-espower).
|
||||
* supports [CoffeeScript](https://github.com/power-assert-js/espower-coffee).
|
||||
* supports [TypeScript](https://github.com/power-assert-js/espower-typescript).
|
||||
* has [TypeScript type definition](https://www.npmjs.com/package/@types/power-assert)
|
||||
* has code migration tool that transforms existing code from [chai](https://github.com/twada/chai-to-assert), [should.js](https://github.com/node-modules/should2assert) and [expect.js](https://github.com/twada/expect-js-to-assert) to assert.
|
||||
* [AVA](https://github.com/avajs/ava), the futuristic test runner, now [comes with power-assert builtin](https://github.com/avajs/ava#enhanced-assertion-messages)
|
||||
* has [Lab transformer](https://github.com/feugy/lab-espower-transformer) to enable power-assert on [Lab](https://github.com/hapijs/lab)
|
||||
* has [module loader](https://github.com/tracecomms/espower-ts-node) to get [ts-node](https://github.com/TypeStrong/ts-node) working together with power-assert
|
||||
* [Wallaby.js](https://wallabyjs.com/) supports power-assert via [Babel compiler/preprocessor](https://github.com/wallabyjs/public/issues/754#issuecomment-241624868)
|
||||
* pull-requests, issue reports and patches are always welcomed.
|
||||
|
||||
|
||||
`power-assert` provides descriptive assertion messages for your tests, like this.
|
||||
|
||||
1) Array #indexOf() should return index when the value is present:
|
||||
AssertionError: # path/to/test/mocha_node.js:10
|
||||
|
||||
assert(ary.indexOf(zero) === two)
|
||||
| | | | |
|
||||
| | | | 2
|
||||
| -1 0 false
|
||||
[1,2,3]
|
||||
|
||||
[number] two
|
||||
=> 2
|
||||
[number] ary.indexOf(zero)
|
||||
=> -1
|
||||
|
||||
|
||||
API
|
||||
---------------------------------------
|
||||
|
||||
power-assert enhances these assert functions by [espower](https://github.com/power-assert-js/espower). Produces descriptive message when assertion is failed.
|
||||
|
||||
* [`assert(value, [message])`](https://nodejs.org/api/assert.html#assert_assert_value_message)
|
||||
* [`assert.ok(value, [message])`](https://nodejs.org/api/assert.html#assert_assert_ok_value_message)
|
||||
* [`assert.equal(actual, expected, [message])`](https://nodejs.org/api/assert.html#assert_assert_equal_actual_expected_message)
|
||||
* [`assert.notEqual(actual, expected, [message])`](https://nodejs.org/api/assert.html#assert_assert_notequal_actual_expected_message)
|
||||
* [`assert.strictEqual(actual, expected, [message])`](https://nodejs.org/api/assert.html#assert_assert_strictequal_actual_expected_message)
|
||||
* [`assert.notStrictEqual(actual, expected, [message])`](https://nodejs.org/api/assert.html#assert_assert_notstrictequal_actual_expected_message)
|
||||
* [`assert.deepEqual(actual, expected, [message])`](https://nodejs.org/api/assert.html#assert_assert_deepequal_actual_expected_message)
|
||||
* [`assert.notDeepEqual(actual, expected, [message])`](https://nodejs.org/api/assert.html#assert_assert_notdeepequal_actual_expected_message)
|
||||
* [`assert.deepStrictEqual(actual, expected, [message])`](https://nodejs.org/api/assert.html#assert_assert_deepstrictequal_actual_expected_message)
|
||||
* [`assert.notDeepStrictEqual(actual, expected, [message])`](https://nodejs.org/api/assert.html#assert_assert_notdeepstrictequal_actual_expected_message)
|
||||
|
||||
power-assert is fully compatible with [assert](https://nodejs.org/api/assert.html). So functions below are also available though they are not enhanced (does not produce descriptive message).
|
||||
|
||||
* [`assert.fail(actual, expected, message, operator)`](https://nodejs.org/api/assert.html#assert_assert_fail_actual_expected_message_operator_stackstartfunction)
|
||||
* [`assert.throws(block, [error], [message])`](https://nodejs.org/api/assert.html#assert_assert_throws_block_error_message)
|
||||
* [`assert.doesNotThrow(block, [message])`](https://nodejs.org/api/assert.html#assert_assert_doesnotthrow_block_error_message)
|
||||
* [`assert.ifError(value)`](https://nodejs.org/api/assert.html#assert_assert_iferror_value)
|
||||
|
||||
Since version 1.5.0, power-assert supports ["strict mode"](https://nodejs.org/api/assert.html#assert_strict_mode) as well.
|
||||
|
||||
power-assert provides an [API for customization](https://github.com/power-assert-js/power-assert#customization-api).
|
||||
|
||||
* `assert.customize(options)`
|
||||
|
||||
|
||||
### No API is the best API
|
||||
|
||||
Though power-assert is fully compatible with standard [assert](https://nodejs.org/api/assert.html) interface, all you need to remember is just an `assert(any_expression)` function in most cases.
|
||||
|
||||
The core value of power-assert is absolute simplicity and stability. Especially, power-assert sticks to the simplest form of testing, `assert(any_expression)`.
|
||||
|
||||
|
||||
assert(types[index].name === bob.name)
|
||||
| || | | | |
|
||||
| || | | | "bob"
|
||||
| || | | Person{name:"bob",age:5}
|
||||
| || | false
|
||||
| |11 "alice"
|
||||
| Person{name:"alice",age:3}
|
||||
["string",98.6,true,false,null,undefined,#Array#,#Object#,NaN,Infinity,/^not/,#Person#]
|
||||
|
||||
--- [string] bob.name
|
||||
+++ [string] types[index].name
|
||||
@@ -1,3 +1,5 @@
|
||||
-bob
|
||||
+alice
|
||||
|
||||
|
||||
FAQ
|
||||
---------------------------------------
|
||||
|
||||
- [Support other assertion styles?](https://github.com/power-assert-js/power-assert/issues/22)
|
||||
- [Does this work with substack/tape?](https://github.com/power-assert-js/power-assert/issues/30)
|
||||
- [Are all dependencies required at runtime?](https://github.com/power-assert-js/power-assert/issues/24)
|
||||
- [Descriptive assertion message does not appear when writing tests in ES6 with Babel](https://github.com/power-assert-js/webpack-espower-loader/issues/4#issuecomment-139605343)
|
||||
- [Incomplete increment/decrement assertion messages?](https://github.com/power-assert-js/power-assert/issues/32)
|
||||
- [Cannot capture not invokable method error](https://github.com/power-assert-js/power-assert/issues/36)
|
||||
- What is the ['Critical dependencies' warning shown by webpack](https://github.com/power-assert-js/babel-plugin-espower/issues/14#issuecomment-197272436) and how to [suppress warnings](https://github.com/power-assert-js/babel-plugin-espower/issues/14#issuecomment-197909419)?
|
||||
- [Causes `TypeError: assert._capt is not a function`](https://github.com/power-assert-js/power-assert/issues/42)
|
||||
- [How to deal with `assert` calls in production](https://github.com/power-assert-js/power-assert/issues/43#issuecomment-208851919)
|
||||
- [Support JSX tags?](https://github.com/power-assert-js/power-assert/issues/34#issuecomment-269848058)
|
||||
- [Any tool to migrate `should/expect` code to `power-assert`?](https://github.com/power-assert-js/power-assert/issues/74)
|
||||
- [Conflicts with babel-plugin-istanbul?](https://github.com/power-assert-js/babel-preset-power-assert/issues/4)
|
||||
- [power-assert message does not appear in Node8](https://github.com/power-assert-js/power-assert/issues/85)
|
||||
|
||||
|
||||
INSTALL
|
||||
---------------------------------------
|
||||
|
||||
`npm install --save-dev power-assert <one of instrumentors>`
|
||||
|
||||
or
|
||||
|
||||
```
|
||||
bower install --save-dev power-assert
|
||||
npm install --save-dev <one of instrumentors>
|
||||
```
|
||||
|
||||
see [list of instrumentors](https://github.com/power-assert-js/power-assert#be-sure-to-transform-test-code)
|
||||
|
||||
|
||||
CHANGELOG
|
||||
---------------------------------------
|
||||
See [CHANGELOG](https://github.com/power-assert-js/power-assert/blob/master/CHANGELOG.md)
|
||||
|
||||
|
||||
EXAMPLE
|
||||
---------------------------------------
|
||||
|
||||
See [HOW TO USE](https://github.com/power-assert-js/power-assert#how-to-use) section for more details.
|
||||
|
||||
__Note:__ There is an [online demo site](https://azu.github.io/power-assert-demo/) available.
|
||||
|
||||
|
||||
### Target test code (using Mocha in this example)
|
||||
|
||||
```javascript
|
||||
'use strict';
|
||||
|
||||
const assert = require('assert');
|
||||
|
||||
describe('Array', function(){
|
||||
let ary;
|
||||
beforeEach(() => {
|
||||
ary = [1,2,3];
|
||||
});
|
||||
describe('#indexOf()', () => {
|
||||
it('should return index when the value is present', () => {
|
||||
const zero = 0, two = 2;
|
||||
assert(ary.indexOf(zero) === two);
|
||||
});
|
||||
it('should return -1 when the value is not present', () => {
|
||||
const minusOne = -1, two = 2;
|
||||
assert.ok(ary.indexOf(two) === minusOne, 'THIS IS AN ASSERTION MESSAGE');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('various types', () => {
|
||||
let types;
|
||||
class Person {
|
||||
constructor(name, age) {
|
||||
this.name = name;
|
||||
this.age = age;
|
||||
}
|
||||
}
|
||||
beforeEach(() => {
|
||||
types = [
|
||||
'string', 98.6, true, false, null, undefined,
|
||||
['nested', 'array'],
|
||||
{object: true},
|
||||
NaN, Infinity,
|
||||
/^not/,
|
||||
new Person('alice', 3)
|
||||
];
|
||||
});
|
||||
it('demo', () => {
|
||||
const index = types.length -1,
|
||||
bob = new Person('bob', 5);
|
||||
assert(types[index].name === bob.name);
|
||||
});
|
||||
});
|
||||
```
|
||||
|
||||
### Be sure to transform test code
|
||||
|
||||
To use power-assert, you need to transform your test code for power-assert output.
|
||||
|
||||
Code transform is done by instrumentors below:
|
||||
|
||||
- [espower-loader](https://github.com/power-assert-js/espower-loader) (with [intelli-espower-loader](https://github.com/power-assert-js/intelli-espower-loader))
|
||||
- [babel-preset-power-assert](https://github.com/power-assert-js/babel-preset-power-assert)
|
||||
- [babel-plugin-espower](https://github.com/power-assert-js/babel-plugin-espower)
|
||||
- [espowerify](https://github.com/power-assert-js/espowerify)
|
||||
- [webpack-espower-loader](https://github.com/power-assert-js/webpack-espower-loader).
|
||||
- [espower-cli](https://github.com/power-assert-js/espower-cli)
|
||||
- [grunt-espower](https://github.com/power-assert-js/grunt-espower)
|
||||
- [gulp-espower](https://github.com/power-assert-js/gulp-espower)
|
||||
- [karma-espower-preprocessor](https://github.com/power-assert-js/karma-espower-preprocessor)
|
||||
- [espower-coffee](https://github.com/power-assert-js/espower-coffee)
|
||||
- [espower-typescript](https://github.com/power-assert-js/espower-typescript)
|
||||
- [espower-traceur](https://github.com/power-assert-js/espower-traceur)
|
||||
|
||||
If you are using Node.js only, the easiest way is to use [intelli-espower-loader](https://github.com/power-assert-js/intelli-espower-loader). Steps are as follows.
|
||||
|
||||
|
||||
### Setup
|
||||
|
||||
`npm install --save-dev mocha power-assert intelli-espower-loader`
|
||||
|
||||
|
||||
### Run
|
||||
|
||||
Put tests into `test` directory then run. You will see the power-assert output appears.
|
||||
|
||||
$ $(npm bin)/mocha --require intelli-espower-loader path/to/test/mocha_node.js
|
||||
|
||||
|
||||
Array
|
||||
#indexOf()
|
||||
1) should return index when the value is present
|
||||
2) should return -1 when the value is not present
|
||||
|
||||
various types
|
||||
3) demo
|
||||
|
||||
|
||||
0 passing (43ms)
|
||||
3 failing
|
||||
|
||||
1) Array #indexOf() should return index when the value is present:
|
||||
|
||||
AssertionError: # test/example2.js:13
|
||||
|
||||
assert(ary.indexOf(zero) === two)
|
||||
| | | | |
|
||||
| | | | 2
|
||||
| -1 0 false
|
||||
[1,2,3]
|
||||
|
||||
[number] two
|
||||
=> 2
|
||||
[number] ary.indexOf(zero)
|
||||
=> -1
|
||||
|
||||
+ expected - actual
|
||||
|
||||
-false
|
||||
+true
|
||||
|
||||
at Context.it (test/example2.js:13:13)
|
||||
|
||||
2) Array #indexOf() should return -1 when the value is not present:
|
||||
|
||||
AssertionError: THIS IS AN ASSERTION MESSAGE # test/example2.js:17
|
||||
|
||||
assert.ok(ary.indexOf(two) === minusOne, 'THIS IS AN ASSERTION MESSAGE')
|
||||
| | | | |
|
||||
| | | | -1
|
||||
| 1 2 false
|
||||
[1,2,3]
|
||||
|
||||
[number] minusOne
|
||||
=> -1
|
||||
[number] ary.indexOf(two)
|
||||
=> 1
|
||||
|
||||
+ expected - actual
|
||||
|
||||
-false
|
||||
+true
|
||||
|
||||
at Context.it (test/example2.js:17:20)
|
||||
|
||||
3) various types demo:
|
||||
|
||||
AssertionError: # test/example2.js:43
|
||||
|
||||
assert(types[index].name === bob.name)
|
||||
| || | | | |
|
||||
| || | | | "bob"
|
||||
| || | | Person{name:"bob",age:5}
|
||||
| || | false
|
||||
| |11 "alice"
|
||||
| Person{name:"alice",age:3}
|
||||
["string",98.6,true,false,null,undefined,#Array#,#Object#,NaN,Infinity,/^not/,#Person#]
|
||||
|
||||
--- [string] bob.name
|
||||
+++ [string] types[index].name
|
||||
@@ -1,3 +1,5 @@
|
||||
-bob
|
||||
+alice
|
||||
|
||||
|
||||
+ expected - actual
|
||||
|
||||
-false
|
||||
+true
|
||||
|
||||
at Context.it (test/example2.js:43:9)
|
||||
|
||||
|
||||
|
||||
SEED PROJECTS
|
||||
---------------------------------------
|
||||
|
||||
Some seed projects are available to help you start with power-assert.
|
||||
|
||||
| module | env | tech stack |
|
||||
|:-------|:------------|:------------|
|
||||
| [power-assert-node-seed](https://github.com/azu/power-assert-node-seed) | Node.js | power-assert + [intelli-espower-loader](https://github.com/power-assert-js/intelli-espower-loader) |
|
||||
| [power-assert-testem-seed](https://github.com/azu/power-assert-testem-seed) | Browsers(by [testem](https://github.com/testem/testem)) | power-assert + [gulp-espower](https://github.com/power-assert-js/gulp-espower) + [testem](https://github.com/airportyh/testem). |
|
||||
| [power-assert-karma-seed](https://github.com/azu/power-assert-karma-seed) | Browsers(by [Karma](https://karma-runner.github.io/)) | power-assert + [espowerify](https://github.com/power-assert-js/espowerify) + [browserify](http://browserify.org/) + [Karma](https://karma-runner.github.io/). |
|
||||
|
||||
|
||||
HOW TO USE
|
||||
---------------------------------------
|
||||
|
||||
There are some ways to use power-assert. (If you want to see running examples, see [SEED PROJECTS](#seed-projects))
|
||||
|
||||
1. `power-assert` + `Babel` + `babel-preset-power-assert`: The only way to enable power-assert if you are using [Babel6+](https://babeljs.io/).
|
||||
2. `power-assert` + `espower-loader` or `intelli-espower-loader` : Simple and recommended (but only works under Node).
|
||||
3. `power-assert` + `espower-coffee` or `espower-typescript`: Use power-assert with AltJS. Recommended but only works under Node.
|
||||
4. `power-assert` + `browserify` + `espowerify`: if you are using [browserify](http://browserify.org/) but not with Babel.
|
||||
5. `power-assert` + `webpack` + `webpack-espower-loader`: if you are using [webpack](https://webpack.github.io/) but not with Babel.
|
||||
6. `power-assert` + `espower-cli` or `grunt-espower` or `gulp-espower` : Generate instrumented code so works anywhere.
|
||||
|
||||
|
||||
### using `babel-preset-power-assert` or `babel-plugin-espower`
|
||||
|
||||
If you are writing your code with Babel, you can instrument Power Assert feature with Babel and babel-preset-power-assert (or babel-plugin-espower).
|
||||
|
||||
see [babel-plugin-espower README](https://github.com/power-assert-js/babel-plugin-espower) and [babel-preset-power-assert README](https://github.com/power-assert-js/babel-preset-power-assert)
|
||||
|
||||
|
||||
### using `espower-loader` or `intelli-espower-loader`
|
||||
|
||||
If you are writing Node.js app/module, you can instrument Power Assert feature without code generation by using `espower-loader`.
|
||||
|
||||
see [espower-loader README](https://github.com/power-assert-js/espower-loader).
|
||||
|
||||
FYI: You may be interested in [intelli-espower-loader](https://github.com/power-assert-js/intelli-espower-loader) to go one step further. With [intelli-espower-loader](https://github.com/power-assert-js/intelli-espower-loader), you don't need to create loader file (like `enable-power-assert.js`). Just define test directory in `package.json` wow!
|
||||
|
||||
|
||||
### using `espower-typescript`
|
||||
|
||||
If you are writing Node.js app/module in TypeScript, you can instrument Power Assert feature without code generation by using `espower-typescript`.
|
||||
|
||||
see [espower-typescript README](https://github.com/power-assert-js/espower-typescript).
|
||||
|
||||
|
||||
### using `espower-coffee`
|
||||
|
||||
If you are writing Node.js app/module in CoffeeScript, you can instrument Power Assert feature without code generation by using `espower-coffee`.
|
||||
|
||||
see [espower-coffee README](https://github.com/power-assert-js/espower-coffee).
|
||||
|
||||
|
||||
### using `espowerify`
|
||||
|
||||
If you are using [browserify](http://browserify.org/) but not with Babel, you can instrument Power Assert feature via `espowerify`.
|
||||
|
||||
see [espowerify README](https://github.com/power-assert-js/espowerify).
|
||||
|
||||
|
||||
### using `webpack-espower-loader`
|
||||
|
||||
If you are using [webpack](https://webpack.github.io/) but not with Babel, you can instrument Power Assert feature via `webpack-espower-loader`.
|
||||
|
||||
see [webpack-espower-loader README](https://github.com/power-assert-js/webpack-espower-loader).
|
||||
|
||||
|
||||
### using `espower-cli`
|
||||
|
||||
If you don't want to use grunt, gulp, browserify, and so on, you can use `power-assert` via bower, with generated code by `espower-cli`
|
||||
|
||||
see [espower-cli README](https://github.com/power-assert-js/espower-cli).
|
||||
|
||||
|
||||
### using `gulp-espower`
|
||||
|
||||
On the browser side and you are not using [browserify](http://browserify.org/) but [bower](https://bower.io/) and [gulp](http://gulpjs.com/), you can use `power-assert` via bower, with generated code by `gulp-espower`
|
||||
|
||||
see [gulp-espower README](https://github.com/power-assert-js/gulp-espower).
|
||||
|
||||
|
||||
### using `grunt-espower`
|
||||
|
||||
On the browser side and you are not using [browserify](http://browserify.org/) but [bower](https://bower.io/) and [Grunt](http://gruntjs.com/), you can use `power-assert` via bower, with generated code by `grunt-espower`
|
||||
|
||||
see [grunt-espower README](https://github.com/power-assert-js/grunt-espower).
|
||||
|
||||
|
||||
|
||||
CUSTOMIZATION API
|
||||
---------------------------------------
|
||||
|
||||
`power-assert` provides an API for customization.
|
||||
|
||||
### var assert = assert.customize(options)
|
||||
|
||||
Through this API, you can customize power-assert by changing some options.
|
||||
|
||||
```javascript
|
||||
var assert = require('power-assert').customize({
|
||||
output: {
|
||||
maxDepth: 2
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
### options
|
||||
|
||||
`options` has two top-level keys. `assertion` and `output`.
|
||||
|
||||
#### options.assertion
|
||||
|
||||
customization options for [empower](https://github.com/power-assert-js/empower) module. See [empower API documentation](https://github.com/power-assert-js/empower#api) for details. Note that some default values are different from `empower`'s (`modifyMessageOnRethrow: true` and `saveContextOnRethrow: true`).
|
||||
|
||||
#### options.output
|
||||
|
||||
customization options for [power-assert-formatter](https://github.com/power-assert-js/power-assert-formatter) module. See [power-assert-formatter API documentation](https://github.com/power-assert-js/power-assert-formatter#api) for details.
|
||||
|
||||
#### default values
|
||||
|
||||
customizable properties and their default values are as follows.
|
||||
|
||||
```javascript
|
||||
var assert = require('power-assert').customize({
|
||||
assertion: {
|
||||
destructive: false,
|
||||
modifyMessageOnRethrow: true,
|
||||
saveContextOnRethrow: true,
|
||||
patterns: [
|
||||
'assert(value, [message])',
|
||||
'assert.ok(value, [message])',
|
||||
'assert.equal(actual, expected, [message])',
|
||||
'assert.notEqual(actual, expected, [message])',
|
||||
'assert.strictEqual(actual, expected, [message])',
|
||||
'assert.notStrictEqual(actual, expected, [message])',
|
||||
'assert.deepEqual(actual, expected, [message])',
|
||||
'assert.notDeepEqual(actual, expected, [message])',
|
||||
'assert.deepStrictEqual(actual, expected, [message])',
|
||||
'assert.notDeepStrictEqual(actual, expected, [message])'
|
||||
]
|
||||
},
|
||||
output: {
|
||||
lineDiffThreshold: 5,
|
||||
maxDepth: 1,
|
||||
anonymous: 'Object',
|
||||
circular: '#@Circular#',
|
||||
lineSeparator: '\n',
|
||||
ambiguousEastAsianCharWidth: 2,
|
||||
widthOf: (Function to calculate width of string. Please see power-assert-formatter's documentation)
|
||||
stringify: (Function to stringify any target value. Please see power-assert-formatter's documentation)
|
||||
diff: (Function to create diff string between two strings. Please see power-assert-formatter's documentation)
|
||||
writerClass: (Constructor Function for output writer class. Please see power-assert-formatter's documentation)
|
||||
renderers: [
|
||||
'./built-in/file',
|
||||
'./built-in/assertion',
|
||||
'./built-in/diagram',
|
||||
'./built-in/binary-expression'
|
||||
]
|
||||
}
|
||||
});
|
||||
```
|
||||
|
||||
|
||||
INTERNAL DESIGN
|
||||
---------------------------------------
|
||||
|
||||
`power-assert` family provides 1 main module, 4 core modules and many more instrumentors.
|
||||
|
||||
|
||||
Main (facade) module is,
|
||||
|
||||
| module | description |
|
||||
|:-------|:------------|
|
||||
| [power-assert](https://github.com/power-assert-js/power-assert) | Standard `assert` function on top of `empower` and `power-assert-formatter` |
|
||||
|
||||
core modules are,
|
||||
|
||||
| module | description |
|
||||
|:-------|:------------|
|
||||
| [empower](https://github.com/power-assert-js/empower) | Power Assert feature enhancer for assert function/object. |
|
||||
| [power-assert-formatter](https://github.com/power-assert-js/power-assert-formatter) | Power Assert output formatter. |
|
||||
| [espower](https://github.com/power-assert-js/espower) | Power Assert feature instrumentor core based on the ECMAScript AST defined in [The ESTree Spec](https://github.com/estree/estree) (formerly known as [Mozilla SpiderMonkey Parser API](https://developer.mozilla.org/en-US/docs/Mozilla/Projects/SpiderMonkey/Parser_API)). |
|
||||
| [espower-source](https://github.com/power-assert-js/espower-source) | Power Assert instrumentor from source to source, with source-map. (Thin wrapper of `espower`). |
|
||||
|
||||
and instrumentors are,
|
||||
|
||||
| module | description |
|
||||
|:-------|:------------|
|
||||
| [espower-loader](https://github.com/power-assert-js/espower-loader) | Node module loader to apply `espower` on the fly. |
|
||||
| [intelli-espower-loader](https://github.com/power-assert-js/intelli-espower-loader) | configure `espower-loader` with ease. |
|
||||
| [babel-preset-power-assert](https://github.com/power-assert-js/babel-preset-power-assert) | [Babel](https://babeljs.io/) preset to instrument power-assert feature into target files. |
|
||||
| [babel-plugin-espower](https://github.com/power-assert-js/babel-plugin-espower) | [Babel](https://babeljs.io/) plugin to instrument power-assert feature into target files. |
|
||||
| [espowerify](https://github.com/power-assert-js/espowerify) | [Browserify](http://browserify.org/) transform to apply `espower` to target files. |
|
||||
| [webpack-espower-loader](https://github.com/power-assert-js/webpack-espower-loader) | Power Assert instrumentor module for [webpack](https://webpack.github.io/). |
|
||||
| [espower-cli](https://github.com/power-assert-js/espower-cli) | Command line tool for power-assert. |
|
||||
| [grunt-espower](https://github.com/power-assert-js/grunt-espower) | Grunt task to apply `espower` to target files. |
|
||||
| [gulp-espower](https://github.com/power-assert-js/gulp-espower) | Gulp plugin to apply `espower` to target files. |
|
||||
| [karma-espower-preprocessor](https://github.com/power-assert-js/karma-espower-preprocessor) | karma-preprocessor for power-assert. |
|
||||
| [espower-coffee](https://github.com/power-assert-js/espower-coffee) | power-assert instrumentor for CoffeeScript. |
|
||||
| [espower-typescript](https://github.com/power-assert-js/espower-typescript) | power-assert instrumentor for TypeScript. |
|
||||
| [espower-traceur](https://github.com/power-assert-js/espower-traceur) | power-assert instrumentor for ES6 using [Traceur Compiler](https://github.com/google/traceur-compiler/). |
|
||||
| [espower-babel](https://github.com/power-assert-js/espower-babel) | [DEPRECATED] power-assert instrumentor for ES6 using [Babel](https://babeljs.io/). |
|
||||
|
||||
|
||||
`power-assert` provides standard [assert](https://nodejs.org/api/assert.html) compatible function with Power Assert feature.
|
||||
(Best fit with [Mocha](https://mochajs.org/). If you use assert-like objects provided by various testing frameworks such as [QUnit](https://qunitjs.com/) or [nodeunit](https://github.com/caolan/nodeunit). Please use [empower](https://github.com/power-assert-js/empower) and [power-assert-formatter](https://github.com/power-assert-js/power-assert-formatter) modules directly).
|
||||
|
||||
|
||||
Internally, `power-assert` uses [empower](https://github.com/power-assert-js/empower) module to enhance power assert feature into the standard [assert](https://nodejs.org/api/assert.html) module, to run with the power assert feature added code by [espower](https://github.com/power-assert-js/espower) module, and prettify output using [power-assert-formatter](https://github.com/power-assert-js/power-assert-formatter).
|
||||
|
||||
|
||||
See [power-assert-demo](https://github.com/twada/power-assert-demo) project for power-assert Demo running with mocha.
|
||||
|
||||
|
||||
SUPPORTED FRAMEWORKS
|
||||
---------------------------------------
|
||||
|
||||
* [Mocha](https://mochajs.org/)
|
||||
* [AVA](https://github.com/sindresorhus/ava)
|
||||
|
||||
|
||||
### FRAMEWORKS KNOWN TO WORK
|
||||
|
||||
* [Jest](https://facebook.github.io/jest/) with Babel
|
||||
* [Karma](https://karma-runner.github.io/) with Mocha
|
||||
* [testem](https://github.com/testem/testem) with Mocha
|
||||
* [QUnit](https://qunitjs.com/)
|
||||
* [nodeunit](https://github.com/caolan/nodeunit)
|
||||
* [buster-assertions](https://docs.busterjs.org/en/latest/modules/buster-assertions/)
|
||||
* [Lab](https://github.com/hapijs/lab)
|
||||
* [Nightmare](http://www.nightmarejs.org/)
|
||||
* [Protractor](http://www.protractortest.org/)
|
||||
* [eater](https://github.com/yosuke-furukawa/eater)
|
||||
|
||||
|
||||
OUR SUPPORT POLICY
|
||||
---------------------------------------
|
||||
|
||||
For the Transpiler side, we support Node under maintenance. In other words, we stop supporting old Node version when [their maintenance ends](https://github.com/nodejs/LTS).
|
||||
|
||||
For the Runtime side, we support [Node under maintenance](https://github.com/nodejs/LTS) and "modern enough" browsers such as Chrome, Firefox, Safari, Edge etc.
|
||||
|
||||
Any other environments are not supported officially (means that we do not test against them on CI service). power-assert is known to work with old browsers, and trying to keep them working though.
|
||||
|
||||
|
||||
AUTHOR
|
||||
---------------------------------------
|
||||
* [Takuto Wada](https://github.com/twada)
|
||||
|
||||
|
||||
CONTRIBUTORS
|
||||
---------------------------------------
|
||||
* [azu (azu)](https://github.com/azu)
|
||||
* [vvakame (Masahiro Wakame)](https://github.com/vvakame)
|
||||
* [yosuke-furukawa (Yosuke Furukawa)](https://github.com/yosuke-furukawa)
|
||||
* [teppeis (Teppei Sato)](https://github.com/teppeis)
|
||||
* [zoncoen (Kenta Mori)](https://github.com/zoncoen)
|
||||
* [falsandtru (falsandtru)](https://github.com/falsandtru)
|
||||
* [jamestalmage (James Talmage)](https://github.com/jamestalmage)
|
||||
* [LeshaKoss (Lesha Koss)](https://github.com/LeshaKoss)
|
||||
* [watilde (Daijirō Wachi)](https://github.com/watilde)
|
||||
|
||||
|
||||
LICENSE
|
||||
---------------------------------------
|
||||
Licensed under the [MIT](https://github.com/power-assert-js/power-assert/blob/master/MIT-LICENSE.txt) license.
|
||||
|
||||
|
||||
|
||||
MORE OUTPUT EXAMPLES
|
||||
---------------------------------------
|
||||
|
||||
### Target test code (using QUnit in this example)
|
||||
|
||||
```javascript
|
||||
var q = require('qunitjs');
|
||||
|
||||
(function () {
|
||||
var empower = require('empower'),
|
||||
formatter = require('power-assert-formatter'),
|
||||
qunitTap = require("qunit-tap");
|
||||
empower(q.assert, formatter(), {destructive: true});
|
||||
qunitTap(q, require('util').puts, {showSourceOnFailure: false});
|
||||
q.config.autorun = false;
|
||||
})();
|
||||
|
||||
q.test('spike', function (assert) {
|
||||
assert.ok(true);
|
||||
|
||||
var hoge = 'foo';
|
||||
var fuga = 'bar';
|
||||
assert.ok(hoge === fuga, 'comment');
|
||||
|
||||
var piyo = 3;
|
||||
assert.ok(fuga === piyo);
|
||||
|
||||
var longString = 'very very loooooooooooooooooooooooooooooooooooooooooooooooooooong message';
|
||||
var anotherLongString = 'yet another loooooooooooooooooooooooooooooooooooooooooooooooooooong message';
|
||||
assert.ok(longString === anotherLongString);
|
||||
|
||||
assert.ok(4 === piyo);
|
||||
|
||||
assert.ok(4 !== 4);
|
||||
|
||||
var falsyStr = '';
|
||||
assert.ok(falsyStr);
|
||||
|
||||
var falsyNum = 0;
|
||||
assert.ok(falsyNum);
|
||||
|
||||
var ary1 = ['foo', 'bar'];
|
||||
var ary2 = ['aaa', 'bbb', 'ccc'];
|
||||
assert.ok(ary1.length === ary2.length);
|
||||
assert.deepEqual(ary1, ary2);
|
||||
|
||||
var actual = 16;
|
||||
assert.ok(5 < actual && actual < 13);
|
||||
|
||||
actual = 4;
|
||||
assert.ok(5 < actual && actual < 13);
|
||||
|
||||
actual = 10;
|
||||
assert.ok(actual < 5 || 13 < actual);
|
||||
|
||||
|
||||
var propName = 'bar',
|
||||
foo = {
|
||||
bar: {
|
||||
baz: false
|
||||
}
|
||||
};
|
||||
|
||||
assert.ok(foo.bar.baz);
|
||||
assert.ok(foo['bar'].baz);
|
||||
assert.ok(foo[propName]['baz']);
|
||||
|
||||
|
||||
var truth = true;
|
||||
assert.ok(!truth);
|
||||
|
||||
|
||||
var func = function () { return false; };
|
||||
assert.ok(func());
|
||||
|
||||
|
||||
var obj = {
|
||||
age: function () {
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
assert.ok(obj.age());
|
||||
|
||||
|
||||
var isFalsy = function (arg) {
|
||||
return !(arg);
|
||||
};
|
||||
var positiveInt = 50;
|
||||
assert.ok(isFalsy(positiveInt));
|
||||
|
||||
|
||||
var sum = function () {
|
||||
var result = 0;
|
||||
for (var i = 0; i < arguments.length; i += 1) {
|
||||
result += arguments[i];
|
||||
}
|
||||
return result;
|
||||
};
|
||||
var one = 1, two = 2, three = 3, seven = 7, ten = 10;
|
||||
assert.ok(sum(one, two, three) === seven);
|
||||
assert.ok(sum(sum(one, two), three) === sum(sum(two, three), seven));
|
||||
assert.ok((three * (seven * ten)) === three);
|
||||
|
||||
|
||||
var math = {
|
||||
calc: {
|
||||
sum: function () {
|
||||
var result = 0;
|
||||
for (var i = 0; i < arguments.length; i += 1) {
|
||||
result += arguments[i];
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
};
|
||||
assert.ok(math.calc.sum(one, two, three) === seven);
|
||||
});
|
||||
|
||||
q.load();
|
||||
```
|
||||
|
||||
|
||||
### `espower` code above then running under Node.js
|
||||
|
||||
```
|
||||
# module: undefined
|
||||
# test: spike
|
||||
ok 1 - okay
|
||||
not ok 2 - comment # path/to/examples/qunit_node.js:17
|
||||
#
|
||||
# assert.ok(hoge === fuga, 'comment')
|
||||
# | | |
|
||||
# | | "bar"
|
||||
# | false
|
||||
# "foo"
|
||||
#
|
||||
# --- [string] fuga
|
||||
# +++ [string] hoge
|
||||
# @@ -1,3 +1,3 @@
|
||||
# -bar
|
||||
# +foo
|
||||
#
|
||||
# , test: spike
|
||||
not ok 3 - # path/to/examples/qunit_node.js:20
|
||||
#
|
||||
# assert.ok(fuga === piyo)
|
||||
# | | |
|
||||
# | | 3
|
||||
# | false
|
||||
# "bar"
|
||||
#
|
||||
# [number] piyo
|
||||
# => 3
|
||||
# [string] fuga
|
||||
# => "bar"
|
||||
|
||||
# , test: spike
|
||||
not ok 4 - # path/to/examples/qunit_node.js:24
|
||||
#
|
||||
# assert.ok(longString === anotherLongString)
|
||||
# | | |
|
||||
# | | "yet another loooooooooooooooooooooooooooooooooooooooooooooooooooong message"
|
||||
# | false
|
||||
# "very very loooooooooooooooooooooooooooooooooooooooooooooooooooong message"
|
||||
#
|
||||
# --- [string] anotherLongString
|
||||
# +++ [string] longString
|
||||
# @@ -1,15 +1,13 @@
|
||||
# -yet anoth
|
||||
# +very v
|
||||
# er
|
||||
# +y
|
||||
# loo
|
||||
#
|
||||
# , test: spike
|
||||
not ok 5 - # path/to/examples/qunit_node.js:26
|
||||
#
|
||||
# assert.ok(4 === piyo)
|
||||
# | |
|
||||
# | 3
|
||||
# false
|
||||
#
|
||||
# [number] piyo
|
||||
# => 3
|
||||
# [number] 4
|
||||
# => 4
|
||||
# , test: spike
|
||||
not ok 6 - # path/to/examples/qunit_node.js:28
|
||||
#
|
||||
# assert.ok(4 !== 4)
|
||||
# |
|
||||
# false
|
||||
# , test: spike
|
||||
not ok 7 - # path/to/examples/qunit_node.js:31
|
||||
#
|
||||
# assert.ok(falsyStr)
|
||||
# |
|
||||
# ""
|
||||
# , test: spike
|
||||
not ok 8 - # path/to/examples/qunit_node.js:34
|
||||
#
|
||||
# assert.ok(falsyNum)
|
||||
# |
|
||||
# 0
|
||||
# , test: spike
|
||||
not ok 9 - # path/to/examples/qunit_node.js:38
|
||||
#
|
||||
# assert.ok(ary1.length === ary2.length)
|
||||
# | | | | |
|
||||
# | | | | 3
|
||||
# | | | ["aaa","bbb","ccc"]
|
||||
# | 2 false
|
||||
# ["foo","bar"]
|
||||
#
|
||||
# [number] ary2.length
|
||||
# => 3
|
||||
# [number] ary1.length
|
||||
# => 2
|
||||
# , test: spike
|
||||
not ok 10 - # path/to/examples/qunit_node.js:39
|
||||
#
|
||||
# assert.deepEqual(ary1, ary2)
|
||||
# | |
|
||||
# | ["aaa","bbb","ccc"]
|
||||
# ["foo","bar"]
|
||||
# , expected: [
|
||||
# "aaa",
|
||||
# "bbb",
|
||||
# "ccc"
|
||||
# ], got: [
|
||||
# "foo",
|
||||
# "bar"
|
||||
# ], test: spike
|
||||
not ok 11 - # path/to/examples/qunit_node.js:42
|
||||
#
|
||||
# assert.ok(5 < actual && actual < 13)
|
||||
# | | | | |
|
||||
# | | | 16 false
|
||||
# | 16 false
|
||||
# true
|
||||
# , test: spike
|
||||
not ok 12 - # path/to/examples/qunit_node.js:45
|
||||
#
|
||||
# assert.ok(5 < actual && actual < 13)
|
||||
# | | |
|
||||
# | 4 false
|
||||
# false
|
||||
# , test: spike
|
||||
not ok 13 - # path/to/examples/qunit_node.js:48
|
||||
#
|
||||
# assert.ok(actual < 5 || 13 < actual)
|
||||
# | | | | |
|
||||
# | | | | 10
|
||||
# | | false false
|
||||
# 10 false
|
||||
# , test: spike
|
||||
not ok 14 - # path/to/examples/qunit_node.js:58
|
||||
#
|
||||
# assert.ok(foo.bar.baz)
|
||||
# | | |
|
||||
# | | false
|
||||
# | Object{baz:false}
|
||||
# Object{bar:#Object#}
|
||||
# , test: spike
|
||||
not ok 15 - # path/to/examples/qunit_node.js:59
|
||||
#
|
||||
# assert.ok(foo['bar'].baz)
|
||||
# | | |
|
||||
# | | false
|
||||
# | Object{baz:false}
|
||||
# Object{bar:#Object#}
|
||||
# , test: spike
|
||||
not ok 16 - # path/to/examples/qunit_node.js:60
|
||||
#
|
||||
# assert.ok(foo[propName]['baz'])
|
||||
# | || |
|
||||
# | |"bar" false
|
||||
# | Object{baz:false}
|
||||
# Object{bar:#Object#}
|
||||
# , test: spike
|
||||
not ok 17 - # path/to/examples/qunit_node.js:64
|
||||
#
|
||||
# assert.ok(!truth)
|
||||
# ||
|
||||
# |true
|
||||
# false
|
||||
# , test: spike
|
||||
not ok 18 - # path/to/examples/qunit_node.js:68
|
||||
#
|
||||
# assert.ok(func())
|
||||
# |
|
||||
# false
|
||||
# , test: spike
|
||||
not ok 19 - # path/to/examples/qunit_node.js:76
|
||||
#
|
||||
# assert.ok(obj.age())
|
||||
# | |
|
||||
# | 0
|
||||
# Object{age:#function#}
|
||||
# , test: spike
|
||||
not ok 20 - # path/to/examples/qunit_node.js:83
|
||||
#
|
||||
# assert.ok(isFalsy(positiveInt))
|
||||
# | |
|
||||
# false 50
|
||||
# , test: spike
|
||||
not ok 21 - # path/to/examples/qunit_node.js:94
|
||||
#
|
||||
# assert.ok(sum(one, two, three) === seven)
|
||||
# | | | | | |
|
||||
# | | | | | 7
|
||||
# 6 1 2 3 false
|
||||
#
|
||||
# [number] seven
|
||||
# => 7
|
||||
# [number] sum(one, two, three)
|
||||
# => 6
|
||||
# , test: spike
|
||||
not ok 22 - # path/to/examples/qunit_node.js:95
|
||||
#
|
||||
# assert.ok(sum(sum(one, two), three) === sum(sum(two, three), seven))
|
||||
# | | | | | | | | | | |
|
||||
# | | | | | | 12 5 2 3 7
|
||||
# 6 3 1 2 3 false
|
||||
#
|
||||
# [number] sum(sum(two, three), seven)
|
||||
# => 12
|
||||
# [number] sum(sum(one, two), three)
|
||||
# => 6
|
||||
# , test: spike
|
||||
not ok 23 - # path/to/examples/qunit_node.js:96
|
||||
#
|
||||
# assert.ok(three * (seven * ten) === three)
|
||||
# | | | | | | |
|
||||
# | | | | | | 3
|
||||
# | | | | 10 false
|
||||
# | | 7 70
|
||||
# 3 210
|
||||
#
|
||||
# [number] three
|
||||
# => 3
|
||||
# [number] three * (seven * ten)
|
||||
# => 210
|
||||
# , test: spike
|
||||
not ok 24 - # path/to/examples/qunit_node.js:110
|
||||
#
|
||||
# assert.ok(math.calc.sum(one, two, three) === seven)
|
||||
# | | | | | | | |
|
||||
# | | | | | | | 7
|
||||
# | | 6 1 2 3 false
|
||||
# | Object{sum:#function#}
|
||||
# Object{calc:#Object#}
|
||||
#
|
||||
# [number] seven
|
||||
# => 7
|
||||
# [number] math.calc.sum(one, two, three)
|
||||
# => 6
|
||||
# , test: spike
|
||||
1..24
|
||||
```
|
||||
|
||||
Have fun!
|
||||
|
||||
|
||||
[power-assert-url]: https://github.com/power-assert-js/power-assert
|
||||
[power-assert-banner]: https://raw.githubusercontent.com/power-assert-js/power-assert-js-logo/master/banner/banner-official-fullcolor.png
|
||||
|
||||
[npm-url]: https://www.npmjs.com/package/power-assert
|
||||
[npm-image]: https://badge.fury.io/js/power-assert.svg
|
||||
|
||||
[bower-url]: https://badge.fury.io/bo/power-assert
|
||||
[bower-image]: https://badge.fury.io/bo/power-assert.svg
|
||||
|
||||
[travis-url]: https://travis-ci.org/power-assert-js/power-assert
|
||||
[travis-image]: https://secure.travis-ci.org/power-assert-js/power-assert.svg?branch=master
|
||||
|
||||
[depstat-url]: https://gemnasium.com/power-assert-js/power-assert
|
||||
[depstat-image]: https://gemnasium.com/power-assert-js/power-assert.svg
|
||||
|
||||
[license-url]: https://github.com/power-assert-js/power-assert/blob/master/MIT-LICENSE.txt
|
||||
[license-image]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat
|
||||
17980
website/functions/node_modules/power-assert/build/power-assert.js
generated
vendored
Normal file
17980
website/functions/node_modules/power-assert/build/power-assert.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
67
website/functions/node_modules/power-assert/index.js
generated
vendored
Normal file
67
website/functions/node_modules/power-assert/index.js
generated
vendored
Normal file
@@ -0,0 +1,67 @@
|
||||
/**
|
||||
* power-assert.js - Power Assert in JavaScript.
|
||||
*
|
||||
* https://github.com/power-assert-js/power-assert
|
||||
*
|
||||
* Copyright (c) 2013-2018 Takuto Wada
|
||||
* Licensed under the MIT license.
|
||||
* https://github.com/power-assert-js/power-assert/blob/master/MIT-LICENSE.txt
|
||||
*/
|
||||
'use strict';
|
||||
|
||||
var baseAssert = require('assert');
|
||||
var _deepEqual = require('universal-deep-strict-equal');
|
||||
var empower = require('empower');
|
||||
var formatter = require('power-assert-formatter');
|
||||
var assign = require('xtend/mutable');
|
||||
var define = require('define-properties');
|
||||
var empowerOptions = {
|
||||
modifyMessageOnRethrow: true,
|
||||
saveContextOnRethrow: true
|
||||
};
|
||||
|
||||
if (typeof baseAssert.deepStrictEqual !== 'function') {
|
||||
baseAssert.deepStrictEqual = function deepStrictEqual (actual, expected, message) {
|
||||
if (!_deepEqual(actual, expected, true)) {
|
||||
baseAssert.fail(actual, expected, message, 'deepStrictEqual');
|
||||
}
|
||||
};
|
||||
}
|
||||
if (typeof baseAssert.notDeepStrictEqual !== 'function') {
|
||||
baseAssert.notDeepStrictEqual = function notDeepStrictEqual (actual, expected, message) {
|
||||
if (_deepEqual(actual, expected, true)) {
|
||||
baseAssert.fail(actual, expected, message, 'notDeepStrictEqual');
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
function customize (customOptions) {
|
||||
var options = customOptions || {};
|
||||
var applyEmpower = function (fn) {
|
||||
return empower(
|
||||
fn,
|
||||
formatter(options.output),
|
||||
assign({}, empowerOptions, options.assertion)
|
||||
);
|
||||
};
|
||||
var poweredAssert = applyEmpower(baseAssert);
|
||||
poweredAssert.customize = customize;
|
||||
if (typeof baseAssert.strict === 'function') {
|
||||
poweredAssert.strict = applyEmpower(baseAssert.strict);
|
||||
} else {
|
||||
var strict = applyEmpower(baseAssert);
|
||||
poweredAssert.strict = assign(strict, {
|
||||
equal: strict.strictEqual,
|
||||
deepEqual: strict.deepStrictEqual,
|
||||
notEqual: strict.notStrictEqual,
|
||||
notDeepEqual: strict.notDeepStrictEqual
|
||||
});
|
||||
}
|
||||
poweredAssert.strict.strict = poweredAssert.strict;
|
||||
return poweredAssert;
|
||||
}
|
||||
|
||||
var defaultAssert = customize();
|
||||
define(defaultAssert, { '__esModule': true });
|
||||
defaultAssert['default'] = defaultAssert;
|
||||
module.exports = defaultAssert;
|
||||
144
website/functions/node_modules/power-assert/package.json
generated
vendored
Normal file
144
website/functions/node_modules/power-assert/package.json
generated
vendored
Normal file
@@ -0,0 +1,144 @@
|
||||
{
|
||||
"_from": "power-assert@^1.4.4",
|
||||
"_id": "power-assert@1.6.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-VWkkZV6Y+W8qLX/PtJu2Ur2jDPIs0a5vbP0TpKeybNcIXmT4vcKoVkyTp5lnQvTpY/DxacAZ4RZisHRHLJcAZQ==",
|
||||
"_location": "/power-assert",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "power-assert@^1.4.4",
|
||||
"name": "power-assert",
|
||||
"escapedName": "power-assert",
|
||||
"rawSpec": "^1.4.4",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^1.4.4"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/google-proto-files"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/power-assert/-/power-assert-1.6.1.tgz",
|
||||
"_shasum": "b28cbc02ae808afd1431d0cd5093a39ac5a5b1fe",
|
||||
"_spec": "power-assert@^1.4.4",
|
||||
"_where": "C:\\Users\\jlevi\\Downloads\\tr2022-strategy-master\\tr2022-strategy-master\\data analysis\\functions\\node_modules\\google-proto-files",
|
||||
"author": {
|
||||
"name": "Takuto Wada",
|
||||
"email": "takuto.wada@gmail.com",
|
||||
"url": "https://github.com/twada"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/power-assert-js/power-assert/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "azu",
|
||||
"url": "https://github.com/azu"
|
||||
},
|
||||
{
|
||||
"name": "Masahiro Wakame",
|
||||
"url": "https://github.com/vvakame"
|
||||
},
|
||||
{
|
||||
"name": "Yosuke Furukawa",
|
||||
"url": "https://github.com/yosuke-furukawa"
|
||||
},
|
||||
{
|
||||
"name": "Teppei Sato",
|
||||
"url": "https://github.com/teppeis"
|
||||
},
|
||||
{
|
||||
"name": "Kenta Mori",
|
||||
"url": "https://github.com/zoncoen"
|
||||
},
|
||||
{
|
||||
"name": "falsandtru",
|
||||
"url": "https://github.com/falsandtru"
|
||||
},
|
||||
{
|
||||
"name": "James Talmage",
|
||||
"url": "https://github.com/jamestalmage"
|
||||
},
|
||||
{
|
||||
"name": "Lesha Koss",
|
||||
"url": "https://github.com/LeshaKoss"
|
||||
},
|
||||
{
|
||||
"name": "Daijirō Wachi",
|
||||
"url": "https://github.com/watilde"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"define-properties": "^1.1.2",
|
||||
"empower": "^1.3.1",
|
||||
"power-assert-formatter": "^1.4.1",
|
||||
"universal-deep-strict-equal": "^1.2.1",
|
||||
"xtend": "^4.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "Power Assert in JavaScript",
|
||||
"devDependencies": {
|
||||
"babel-cli": "^6.0.0",
|
||||
"babel-plugin-espower": "^2.2.0",
|
||||
"babel-plugin-transform-object-rest-spread": "^6.0.0",
|
||||
"babel-preset-env": "^1.7.0",
|
||||
"babel-register": "^6.0.0",
|
||||
"browserify": "^13.0.1",
|
||||
"derequire": "^2.0.3",
|
||||
"dereserve": "^1.0.0",
|
||||
"expect.js": "^0.3.1",
|
||||
"karma": "^2.0.0",
|
||||
"karma-chrome-launcher": "^2.0.0",
|
||||
"karma-expect": "^1.1.2",
|
||||
"karma-firefox-launcher": "^1.0.0",
|
||||
"karma-mocha": "^1.0.0",
|
||||
"licensify": "^3.0.0",
|
||||
"mocha": "^5.0.0",
|
||||
"package-json-filterify": "^1.0.4",
|
||||
"qunit-tap": "^1.5.0",
|
||||
"qunitjs": "1.14.0",
|
||||
"requirejs": "^2.2.0",
|
||||
"semver": "^5.5.0"
|
||||
},
|
||||
"files": [
|
||||
"CHANGELOG.md",
|
||||
"MIT-LICENSE.txt",
|
||||
"README.md",
|
||||
"index.js",
|
||||
"build/power-assert.js",
|
||||
"package.json"
|
||||
],
|
||||
"homepage": "https://github.com/power-assert-js/power-assert",
|
||||
"keywords": [
|
||||
"power-assert",
|
||||
"assert",
|
||||
"assertion",
|
||||
"test",
|
||||
"testing",
|
||||
"ecmascript",
|
||||
"ast"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./index.js",
|
||||
"name": "power-assert",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/power-assert-js/power-assert.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "mkdir -p ./build && npm prune && npm dedupe && browserify -p licensify --global-transform package-json-filterify --standalone assert ./index.js | dereserve | derequire > build/power-assert.js",
|
||||
"clean": "rm -rf ./espowered_tests && rm -rf ./build",
|
||||
"preversion": "npm test",
|
||||
"setup": "npm run clean && npm run setup-dir && npm run setup-espower && npm run build",
|
||||
"setup-dir": "mkdir -p ./build && mkdir -p ./espowered_tests/tobe_instrumented && cp -r test/not_tobe_instrumented/ ./espowered_tests/not_tobe_instrumented/",
|
||||
"setup-espower": "for i in $(find ./test/tobe_instrumented -name '*.js'); do babel $i > ./espowered_tests/tobe_instrumented/$(basename $i); done",
|
||||
"test": "npm run setup && npm run test-all",
|
||||
"test-all": "npm run test-unit && npm run test-generated && npm run test-browser",
|
||||
"test-browser": "karma start",
|
||||
"test-generated": "mocha --reporter dot ./espowered_tests/**/*.js",
|
||||
"test-unit": "mocha --reporter dot --require ./enable_power_assert.js ./test/**/*.js",
|
||||
"version": "npm run build && git add -A build"
|
||||
},
|
||||
"version": "1.6.1"
|
||||
}
|
||||
Reference in New Issue
Block a user