added unit testing, and started implementing unit tests...phew
This commit is contained in:
1
node_modules/chai/CODEOWNERS
generated
vendored
Normal file
1
node_modules/chai/CODEOWNERS
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
* @chaijs/chai
|
58
node_modules/chai/CODE_OF_CONDUCT.md
generated
vendored
Normal file
58
node_modules/chai/CODE_OF_CONDUCT.md
generated
vendored
Normal file
@ -0,0 +1,58 @@
|
||||
# Contributor Code of Conduct
|
||||
|
||||
> Read in: [Español](http://contributor-covenant.org/version/1/3/0/es/) |
|
||||
[Français](http://contributor-covenant.org/version/1/3/0/fr/) |
|
||||
[Italiano](http://contributor-covenant.org/version/1/3/0/it/) |
|
||||
[Magyar](http://contributor-covenant.org/version/1/3/0/hu/) |
|
||||
[Polskie](http://contributor-covenant.org/version/1/3/0/pl/) |
|
||||
[Português](http://contributor-covenant.org/version/1/3/0/pt/) |
|
||||
[Português do Brasil](http://contributor-covenant.org/version/1/3/0/pt_br/)
|
||||
|
||||
As contributors and maintainers of this project, and in the interest of
|
||||
fostering an open and welcoming community, we pledge to respect all people who
|
||||
contribute through reporting issues, posting feature requests, updating
|
||||
documentation, submitting pull requests or patches, and other activities.
|
||||
|
||||
We are committed to making participation in this project a harassment-free
|
||||
experience for everyone, regardless of level of experience, gender, gender
|
||||
identity and expression, sexual orientation, disability, personal appearance,
|
||||
body size, race, ethnicity, age, religion, or nationality.
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery
|
||||
* Personal attacks
|
||||
* Trolling or insulting/derogatory comments
|
||||
* Public or private harassment
|
||||
* Publishing other's private information, such as physical or electronic
|
||||
addresses, without explicit permission
|
||||
* Other unethical or unprofessional conduct
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
By adopting this Code of Conduct, project maintainers commit themselves to
|
||||
fairly and consistently applying these principles to every aspect of managing
|
||||
this project. Project maintainers who do not follow or enforce the Code of
|
||||
Conduct may be permanently removed from the project team.
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community.
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting a project maintainer at chaijs@keithcirkel.co.uk. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. Maintainers are
|
||||
obligated to maintain confidentiality with regard to the reporter of an
|
||||
incident.
|
||||
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
||||
version 1.3.0, available at
|
||||
[http://contributor-covenant.org/version/1/3/0/][version]
|
||||
|
||||
[homepage]: http://contributor-covenant.org
|
||||
[version]: http://contributor-covenant.org/version/1/3/0/
|
218
node_modules/chai/CONTRIBUTING.md
generated
vendored
Normal file
218
node_modules/chai/CONTRIBUTING.md
generated
vendored
Normal file
@ -0,0 +1,218 @@
|
||||
# Chai Contribution Guidelines
|
||||
|
||||
We like to encourage you to contribute to the Chai.js repository. This should be as easy as possible for you but there are a few things to consider when contributing. The following guidelines for contribution should be followed if you want to submit a pull request or open an issue.
|
||||
|
||||
Following these guidelines helps to communicate that you respect the time of the developers managing and developing this open source project. In return, they should reciprocate that respect in addressing your issue or assessing patches and features.
|
||||
|
||||
#### Table of Contents
|
||||
|
||||
- [TLDR;](#tldr)
|
||||
- [Contributing](#contributing)
|
||||
- [Bug Reports](#bugs)
|
||||
- [Feature Requests](#features)
|
||||
- [Pull Requests](#pull-requests)
|
||||
- [Releasing](#releasing)
|
||||
- [Support](#support)
|
||||
- [Resources](#resources)
|
||||
- [Core Contributors](#contributors)
|
||||
|
||||
<a name="tldr"></a>
|
||||
## TLDR;
|
||||
|
||||
- Creating an Issue or Pull Request requires a [GitHub](http://github.com) account.
|
||||
- Issue reports should be **clear**, **concise** and **reproducible**. Check to see if your issue has already been resolved in the [master]() branch or already reported in Chai's [GitHub Issue Tracker](https://github.com/chaijs/chai/issues).
|
||||
- Pull Requests must adhere to strict [coding style guidelines](https://github.com/chaijs/chai/wiki/Chai-Coding-Style-Guide).
|
||||
- In general, avoid submitting PRs for new Assertions without asking core contributors first. More than likely it would be better implemented as a plugin.
|
||||
- Additional support is available via the [Google Group](http://groups.google.com/group/chaijs) or on irc.freenode.net#chaijs.
|
||||
- **IMPORTANT**: By submitting a patch, you agree to allow the project owner to license your work under the same license as that used by the project.
|
||||
|
||||
|
||||
|
||||
<a name="contributing"></a>
|
||||
## Contributing
|
||||
|
||||
The issue tracker is the preferred channel for [bug reports](#bugs),
|
||||
[feature requests](#features) and [submitting pull
|
||||
requests](#pull-requests), but please respect the following restrictions:
|
||||
|
||||
* Please **do not** use the issue tracker for personal support requests (use
|
||||
[Google Group](https://groups.google.com/forum/#!forum/chaijs) or IRC).
|
||||
* Please **do not** derail or troll issues. Keep the discussion on topic and
|
||||
respect the opinions of others
|
||||
|
||||
<a name="bugs"></a>
|
||||
### Bug Reports
|
||||
|
||||
A bug is a **demonstrable problem** that is caused by the code in the repository.
|
||||
|
||||
Guidelines for bug reports:
|
||||
|
||||
1. **Use the GitHub issue search** — check if the issue has already been reported.
|
||||
2. **Check if the issue has been fixed** — try to reproduce it using the latest `master` or development branch in the repository.
|
||||
3. **Isolate the problem** — create a test case to demonstrate your issue. Provide either a repo, gist, or code sample to demonstrate you problem.
|
||||
|
||||
A good bug report shouldn't leave others needing to chase you up for more information. Please try to be as detailed as possible in your report. What is your environment? What steps will reproduce the issue? What browser(s) and/or Node.js versions experience the problem? What would you expect to be the outcome? All these details will help people to fix any potential bugs.
|
||||
|
||||
Example:
|
||||
|
||||
> Short and descriptive example bug report title
|
||||
>
|
||||
> A summary of the issue and the browser/OS environment in which it occurs. If suitable, include the steps required to reproduce the bug.
|
||||
>
|
||||
> 1. This is the first step
|
||||
> 2. This is the second step
|
||||
> 3. Further steps, etc.
|
||||
>
|
||||
> `<url>` - a link to the reduced test case OR
|
||||
> ```js
|
||||
> expect(a).to.equal('a');
|
||||
> // code sample
|
||||
> ```
|
||||
>
|
||||
> Any other information you want to share that is relevant to the issue being reported. This might include the lines of code that you have identified as causing the bug, and potential solutions (and your opinions on their merits).
|
||||
|
||||
<a name="features"></a>
|
||||
### Feature Requests
|
||||
|
||||
Feature requests are welcome. But take a moment to find out whether your idea fits with the scope and aims of the project. It's up to *you* to make a strong case to convince the project's developers of the merits of this feature. Please provide as much detail and context as possible.
|
||||
|
||||
Furthermore, since Chai.js has a [robust plugin API](http://chaijs.com/guide/plugins/), we encourage you to publish **new Assertions** as plugins. If your feature is an enhancement to an **existing Assertion**, please propose your changes as an issue prior to opening a pull request. If the core Chai.js contributors feel your plugin would be better suited as a core assertion, they will invite you to open a PR in [chaijs/chai](https://github.com/chaijs/chai).
|
||||
|
||||
<a name="pull-requests"></a>
|
||||
### Pull Requests
|
||||
|
||||
- PRs for new core-assertions are advised against.
|
||||
- PRs for core-assertion bug fixes are always welcome.
|
||||
- PRs for enhancing the interfaces are always welcome.
|
||||
- PRs that increase test coverage are always welcome.
|
||||
- PRs are scrutinized for coding-style.
|
||||
|
||||
Good pull requests - patches, improvements, new features - are a fantastic help. They should remain focused in scope and avoid containing unrelated commits.
|
||||
|
||||
**Please ask first** before embarking on any significant pull request (e.g. implementing features, refactoring code), otherwise you risk spending a lot of time working on something that the project's developers might not want to merge into the project.
|
||||
|
||||
Please adhere to the coding conventions used throughout a project (indentation, accurate comments, etc.) and any other requirements (such as test coverage). Please review the [Chai.js Coding Style Guide](https://github.com/chaijs/chai/wiki/Chai-Coding-Style-Guide).
|
||||
|
||||
Follow this process if you'd like your work considered for inclusion in the project:
|
||||
|
||||
1. [Fork](http://help.github.com/fork-a-repo/) the project, clone your fork, and configure the remotes:
|
||||
|
||||
```bash
|
||||
# Clone your fork of the repo into the current directory
|
||||
git clone https://github.com/<your-username>/<repo-name>
|
||||
# Navigate to the newly cloned directory
|
||||
cd <repo-name>
|
||||
# Assign the original repo to a remote called "upstream"
|
||||
git remote add upstream https://github.com/<upstream-owner>/<repo-name>
|
||||
```
|
||||
|
||||
2. If you cloned a while ago, get the latest changes from upstream:
|
||||
|
||||
```bash
|
||||
git checkout <dev-branch>
|
||||
git pull upstream <dev-branch>
|
||||
```
|
||||
|
||||
3. Create a new topic branch (off the main project development branch) to contain your feature, change, or fix:
|
||||
|
||||
```bash
|
||||
git checkout -b <topic-branch-name>
|
||||
```
|
||||
|
||||
4. Commit your changes in logical chunks. Use Git's [interactive rebase](https://help.github.com/articles/interactive-rebase) feature to tidy up your commits before making them public.
|
||||
|
||||
5. Run you code to make sure it works. If you're still having problems please try to run `make clean` and then test your code again.
|
||||
|
||||
```bash
|
||||
npm test
|
||||
# when finished running tests...
|
||||
git checkout chai.js
|
||||
```
|
||||
|
||||
6. Locally merge (or rebase) the upstream development branch into your topic branch:
|
||||
|
||||
```bash
|
||||
git pull [--rebase] upstream <dev-branch>
|
||||
```
|
||||
|
||||
7. Push your topic branch up to your fork:
|
||||
|
||||
```bash
|
||||
git push origin <topic-branch-name>
|
||||
```
|
||||
|
||||
8. [Open a Pull Request](https://help.github.com/articles/using-pull-requests/) with a clear title and description.
|
||||
|
||||
**IMPORTANT**: By submitting a patch, you agree to allow the project owner to license your work under the same license as that used by the project.
|
||||
|
||||
<a name="releasing"></a>
|
||||
## Releasing
|
||||
|
||||
Releases can be **prepared** by anyone with access to the code.
|
||||
|
||||
Simply run `make release-major`, `make release-minor`, or `make-release-patch`
|
||||
and it will automatically do the following:
|
||||
|
||||
- Build chai.js
|
||||
- Bump the version numbers across the project
|
||||
- Make a commit within git
|
||||
|
||||
All you need to do is push the commit up and make a pull request, one of the core contributors will merge it and publish a release.
|
||||
|
||||
### Publishing a Release
|
||||
|
||||
Anyone who is a core contributor (see the [Core Contributors Heading in the Readme](https://github.com/chaijs/chai#core-contributors)) can publish a release:
|
||||
|
||||
1. Go to the [Releases page on Github](https://github.com/chaijs/chai/releases)
|
||||
2. Hit "Draft a new release" (if you can't see this, you're not a core contributor!)
|
||||
3. Write human-friendly Release Notes based on changelog.
|
||||
- The release title is "x.x.x / YYYY-MM-DD" (where x.x.x is the version number)
|
||||
- If breaking changes, write migration tutorial(s) and reasoning.
|
||||
- Callouts for community contributions (PRs) with links to PR and contributing user.
|
||||
- Callouts for other fixes made by core contributors with links to issue.
|
||||
4. Hit "Save Draft" and get other core contributors to check your work, or alternatively hit "Publish release"
|
||||
5. That's it!
|
||||
|
||||
<a name="support"></a>
|
||||
## Support
|
||||
|
||||
<a name="resources"></a>
|
||||
### Resources
|
||||
|
||||
For most of the documentation you are going to want to visit [ChaiJS.com](http://chaijs.com).
|
||||
|
||||
- [Getting Started Guide](http://chaijs.com/guide/)
|
||||
- [API Reference](http://chaijs.com/api/)
|
||||
- [Plugins](http://chaijs.com/plugins/)
|
||||
|
||||
Alternatively, the [wiki](https://github.com/chaijs/chai/wiki) might be what you are looking for.
|
||||
|
||||
- [Chai Coding Style Guide](https://github.com/chaijs/chai/wiki/Chai-Coding-Style-Guide)
|
||||
- [Third-party Resources](https://github.com/chaijs/chai/wiki/Third-Party-Resources)
|
||||
|
||||
Or finally, you may find a core-contributor or like-minded developer in any of our support channels.
|
||||
|
||||
- IRC: irc.freenode.org #chaijs
|
||||
- [Mailing List / Google Group](https://groups.google.com/forum/#!forum/chaijs)
|
||||
|
||||
<a name="contributors"></a>
|
||||
### Core Contributors
|
||||
|
||||
Feel free to reach out to any of the core-contributors with you questions or concerns. We will do our best to respond in a timely manner.
|
||||
|
||||
- Jake Luer
|
||||
- GH: [@logicalparadox](https://github.com/logicalparadox)
|
||||
- TW: [@jakeluer](http://twitter.com/jakeluer)
|
||||
- IRC: logicalparadox
|
||||
- Veselin Todorov
|
||||
- GH: [@vesln](https://github.com/vesln/)
|
||||
- TW: [@vesln](http://twitter.com/vesln)
|
||||
- IRC: vesln
|
||||
- Keith Cirkel
|
||||
- GH: [@keithamus](https://github.com/keithamus)
|
||||
- TW: [@keithamus](http://twitter.com/keithamus)
|
||||
- IRC: keithamus
|
||||
- Lucas Fernandes da Costa
|
||||
- GH: [@lucasfcosta](https://github.com/lucasfcosta)
|
||||
- TW: [@lfernandescosta](https://twitter.com/lfernandescosta)
|
||||
- IRC: lucasfcosta
|
1059
node_modules/chai/History.md
generated
vendored
Normal file
1059
node_modules/chai/History.md
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
21
node_modules/chai/LICENSE
generated
vendored
Normal file
21
node_modules/chai/LICENSE
generated
vendored
Normal file
@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Chai.js Assertion Library
|
||||
|
||||
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.
|
212
node_modules/chai/README.md
generated
vendored
Normal file
212
node_modules/chai/README.md
generated
vendored
Normal file
@ -0,0 +1,212 @@
|
||||
<h1 align=center>
|
||||
<a href="http://chaijs.com" title="Chai Documentation">
|
||||
<img alt="ChaiJS" src="http://chaijs.com/img/chai-logo.png">
|
||||
</a>
|
||||
<br>
|
||||
chai
|
||||
</h1>
|
||||
|
||||
<p align=center>
|
||||
Chai is a BDD / TDD assertion library for <a href="http://nodejs.org">node</a> and the browser that can be delightfully paired with any javascript testing framework.
|
||||
</p>
|
||||
|
||||
<p align=center>
|
||||
<a href="./LICENSE">
|
||||
<img
|
||||
alt="license:mit"
|
||||
src="https://img.shields.io/badge/license-mit-green.svg?style=flat-square"
|
||||
/>
|
||||
</a>
|
||||
<a href="https://github.com/chaijs/chai/releases">
|
||||
<img
|
||||
alt="tag:?"
|
||||
src="https://img.shields.io/github/tag/chaijs/chai.svg?style=flat-square"
|
||||
/>
|
||||
</a>
|
||||
<a href="https://www.npmjs.com/package/chai">
|
||||
<img
|
||||
alt="node:?"
|
||||
src="https://img.shields.io/badge/node-%3E=4.0-blue.svg?style=flat-square"
|
||||
/>
|
||||
</a>
|
||||
<br/>
|
||||
<a href="https://saucelabs.com/u/chaijs">
|
||||
<img
|
||||
alt="Selenium Test Status"
|
||||
src="https://saucelabs.com/browser-matrix/chaijs.svg"
|
||||
/>
|
||||
</a>
|
||||
<br/>
|
||||
<a href="https://www.npmjs.com/packages/chai">
|
||||
<img
|
||||
alt="downloads:?"
|
||||
src="https://img.shields.io/npm/dm/chai.svg?style=flat-square"
|
||||
/>
|
||||
</a>
|
||||
<a href="https://travis-ci.org/chaijs/chai">
|
||||
<img
|
||||
alt="build:?"
|
||||
src="https://img.shields.io/travis/chaijs/chai/master.svg?style=flat-square"
|
||||
/>
|
||||
</a>
|
||||
<a href="https://codecov.io/gh/chaijs/chai">
|
||||
<img
|
||||
alt="coverage:?"
|
||||
src="https://img.shields.io/codecov/c/github/chaijs/chai.svg?style=flat-square"
|
||||
/>
|
||||
</a>
|
||||
<a href="">
|
||||
<img
|
||||
alt="devDependencies:?"
|
||||
src="https://img.shields.io/david/chaijs/chai.svg?style=flat-square"
|
||||
/>
|
||||
</a>
|
||||
<br/>
|
||||
<a href="https://chai-slack.herokuapp.com/">
|
||||
<img
|
||||
alt="Join the Slack chat"
|
||||
src="https://img.shields.io/badge/slack-join%20chat-E2206F.svg?style=flat-square"
|
||||
/>
|
||||
</a>
|
||||
<a href="https://gitter.im/chaijs/chai">
|
||||
<img
|
||||
alt="Join the Gitter chat"
|
||||
src="https://img.shields.io/badge/gitter-join%20chat-D0104D.svg?style=flat-square"
|
||||
/>
|
||||
</a>
|
||||
<a href="https://opencollective.com/chaijs">
|
||||
<img
|
||||
alt="OpenCollective Backers"
|
||||
src="https://opencollective.com/chaijs/backers/badge.svg?style=flat-square"
|
||||
/>
|
||||
</a>
|
||||
</p>
|
||||
|
||||
For more information or to download plugins, view the [documentation](http://chaijs.com).
|
||||
|
||||
## What is Chai?
|
||||
|
||||
Chai is an _assertion library_, similar to Node's built-in `assert`. It makes testing much easier by giving you lots of assertions you can run against your code.
|
||||
|
||||
## Installation
|
||||
|
||||
### Node.js
|
||||
|
||||
`chai` is available on [npm](http://npmjs.org). To install it, type:
|
||||
|
||||
$ npm install chai
|
||||
|
||||
### Browsers
|
||||
|
||||
You can also use it within the browser; install via npm and use the `chai.js` file found within the download. For example:
|
||||
|
||||
```html
|
||||
<script src="./node_modules/chai/chai.js"></script>
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
Import the library in your code, and then pick one of the styles you'd like to use - either `assert`, `expect` or `should`:
|
||||
|
||||
```js
|
||||
var chai = require('chai');
|
||||
var assert = chai.assert; // Using Assert style
|
||||
var expect = chai.expect; // Using Expect style
|
||||
var should = chai.should(); // Using Should style
|
||||
```
|
||||
|
||||
### Pre-Native Modules Usage (_registers the chai testing style globally_)
|
||||
|
||||
```js
|
||||
require('chai/register-assert'); // Using Assert style
|
||||
require('chai/register-expect'); // Using Expect style
|
||||
require('chai/register-should'); // Using Should style
|
||||
```
|
||||
|
||||
### Pre-Native Modules Usage (_as local variables_)
|
||||
|
||||
```js
|
||||
const { assert } = require('chai'); // Using Assert style
|
||||
const { expect } = require('chai'); // Using Expect style
|
||||
const { should } = require('chai'); // Using Should style
|
||||
should(); // Modifies `Object.prototype`
|
||||
|
||||
const { expect, use } = require('chai'); // Creates local variables `expect` and `use`; useful for plugin use
|
||||
```
|
||||
|
||||
### Native Modules Usage (_registers the chai testing style globally_)
|
||||
|
||||
```js
|
||||
import 'chai/register-assert'; // Using Assert style
|
||||
import 'chai/register-expect'; // Using Expect style
|
||||
import 'chai/register-should'; // Using Should style
|
||||
```
|
||||
|
||||
### Native Modules Usage (_local import only_)
|
||||
|
||||
```js
|
||||
import { assert } from 'chai'; // Using Assert style
|
||||
import { expect } from 'chai'; // Using Expect style
|
||||
import { should } from 'chai'; // Using Should style
|
||||
should(); // Modifies `Object.prototype`
|
||||
```
|
||||
|
||||
### Usage with Mocha
|
||||
|
||||
```bash
|
||||
mocha spec.js -r chai/register-assert # Using Assert style
|
||||
mocha spec.js -r chai/register-expect # Using Expect style
|
||||
mocha spec.js -r chai/register-should # Using Should style
|
||||
```
|
||||
|
||||
[Read more about these styles in our docs](http://chaijs.com/guide/styles/).
|
||||
|
||||
## Plugins
|
||||
|
||||
Chai offers a robust Plugin architecture for extending Chai's assertions and interfaces.
|
||||
|
||||
- Need a plugin? View the [official plugin list](http://chaijs.com/plugins).
|
||||
- Want to build a plugin? Read the [plugin api documentation](http://chaijs.com/guide/plugins/).
|
||||
- Have a plugin and want it listed? Simply add the following keywords to your package.json:
|
||||
- `chai-plugin`
|
||||
- `browser` if your plugin works in the browser as well as Node.js
|
||||
- `browser-only` if your plugin does not work with Node.js
|
||||
|
||||
### Related Projects
|
||||
|
||||
- [chaijs / chai-docs](https://github.com/chaijs/chai-docs): The chaijs.com website source code.
|
||||
- [chaijs / assertion-error](https://github.com/chaijs/assertion-error): Custom `Error` constructor thrown upon an assertion failing.
|
||||
- [chaijs / deep-eql](https://github.com/chaijs/deep-eql): Improved deep equality testing for Node.js and the browser.
|
||||
- [chaijs / type-detect](https://github.com/chaijs/type-detect): Improved typeof detection for Node.js and the browser.
|
||||
- [chaijs / check-error](https://github.com/chaijs/check-error): Error comparison and information related utility for Node.js and the browser.
|
||||
- [chaijs / loupe](https://github.com/chaijs/loupe): Inspect utility for Node.js and browsers.
|
||||
- [chaijs / pathval](https://github.com/chaijs/pathval): Object value retrieval given a string path.
|
||||
- [chaijs / get-func-name](https://github.com/chaijs/get-func-name): Utility for getting a function's name for node and the browser.
|
||||
|
||||
### Contributing
|
||||
|
||||
Thank you very much for considering to contribute!
|
||||
|
||||
Please make sure you follow our [Code Of Conduct](https://github.com/chaijs/chai/blob/master/CODE_OF_CONDUCT.md) and we also strongly recommend reading our [Contributing Guide](https://github.com/chaijs/chai/blob/master/CONTRIBUTING.md).
|
||||
|
||||
Here are a few issues other contributors frequently ran into when opening pull requests:
|
||||
|
||||
- Please do not commit changes to the `chai.js` build. We do it once per release.
|
||||
- Before pushing your commits, please make sure you [rebase](https://github.com/chaijs/chai/blob/master/CONTRIBUTING.md#pull-requests) them.
|
||||
|
||||
### Contributors
|
||||
|
||||
Please see the full
|
||||
[Contributors Graph](https://github.com/chaijs/chai/graphs/contributors) for our
|
||||
list of contributors.
|
||||
|
||||
### Core Contributors
|
||||
|
||||
Feel free to reach out to any of the core contributors with your questions or
|
||||
concerns. We will do our best to respond in a timely manner.
|
||||
|
||||
[](https://github.com/logicalparadox)
|
||||
[](https://github.com/vesln)
|
||||
[](https://github.com/keithamus)
|
||||
[](https://github.com/lucasfcosta)
|
||||
[](https://github.com/meeber)
|
737
node_modules/chai/ReleaseNotes.md
generated
vendored
Normal file
737
node_modules/chai/ReleaseNotes.md
generated
vendored
Normal file
@ -0,0 +1,737 @@
|
||||
# Release Notes
|
||||
|
||||
## Note
|
||||
|
||||
As of 3.0.0, the ReleaseNotes.md file has been deprecated. [Please refer to the release notes available on Github](https://github.com/chaijs/chai/releases). Or
|
||||
[the release notes on the chaijs.com website](https://chaijs.com/releases).
|
||||
|
||||
---
|
||||
|
||||
## 2.3.0 / 2015-04-26
|
||||
|
||||
Added `ownPropertyDescriptor` assertion:
|
||||
|
||||
```js
|
||||
expect('test').to.have.ownPropertyDescriptor('length');
|
||||
expect('test').to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 4 });
|
||||
expect('test').not.to.have.ownPropertyDescriptor('length', { enumerable: false, configurable: false, writable: false, value: 3 });
|
||||
expect('test').ownPropertyDescriptor('length').to.have.property('enumerable', false);
|
||||
expect('test').ownPropertyDescriptor('length').to.have.keys('value');
|
||||
```
|
||||
|
||||
### Community Contributions
|
||||
|
||||
#### Code Features & Fixes
|
||||
|
||||
* [#408](https://github.com/chaijs/chai/pull/408) Add `ownPropertyDescriptor`
|
||||
assertion.
|
||||
By [@ljharb](https://github.com/ljharb)
|
||||
* [#422](https://github.com/chaijs/chai/pull/422) Improve ownPropertyDescriptor
|
||||
tests.
|
||||
By [@ljharb](https://github.com/ljharb)
|
||||
|
||||
#### Documentation fixes
|
||||
|
||||
* [#417](https://github.com/chaijs/chai/pull/417) Fix documentation typo
|
||||
By [@astorije](https://github.com/astorije)
|
||||
* [#423](https://github.com/chaijs/chai/pull/423) Fix inconsistency in docs.
|
||||
By [@ehntoo](https://github.com/ehntoo)
|
||||
|
||||
|
||||
## 2.2.0 / 2015-03-26
|
||||
|
||||
Deep property strings can now be escaped using `\\` - for example:
|
||||
|
||||
```js
|
||||
var deepCss = { '.link': { '[target]': 42 }};
|
||||
expect(deepCss).to.have.deep.property('\\.link.\\[target\\]', 42)
|
||||
```
|
||||
|
||||
### Community Contributions
|
||||
|
||||
#### Code Features & Fixes
|
||||
|
||||
* [#402](https://github.com/chaijs/chai/pull/402) Allow escaping of deep
|
||||
property keys.
|
||||
By [@umireon](https://github.com/umireon)
|
||||
|
||||
#### Documentation fixes
|
||||
|
||||
* [#405](https://github.com/chaijs/chai/pull/405) Tweak documentation around
|
||||
deep property escaping.
|
||||
By [@keithamus](https://github.com/keithamus)
|
||||
|
||||
|
||||
## 2.1.2 / 2015-03-15
|
||||
|
||||
A minor bug fix. No new features.
|
||||
|
||||
### Community Contributions
|
||||
|
||||
#### Code Features & Fixes
|
||||
|
||||
* [#395](https://github.com/chaijs/chai/pull/395) Fix eval-related bugs with
|
||||
assert.operator ([#386](https://github.com/chaijs/chai/pull/386)).
|
||||
By [@cjqed](https://github.com/cjqed)
|
||||
|
||||
## 2.1.1 / 2015-03-04
|
||||
|
||||
Two minor bugfixes. No new features.
|
||||
|
||||
### Community Contributions
|
||||
|
||||
#### Code Features & Fixes
|
||||
|
||||
* [#385](https://github.com/chaijs/chai/pull/385) Fix a bug (also described in
|
||||
[#387](https://github.com/chaijs/chai/pull/385)) where `deep.property` would not work with single
|
||||
key names. By [@eldritch-fossicker](https://github.com/eldritch-fossicker)
|
||||
* [#379](https://github.com/chaijs/chai/pull/379) Fix bug where tools which overwrite
|
||||
primitive prototypes, such as Babel or core-js would fail.
|
||||
By [@dcneiner](https://github.com/dcneiner)
|
||||
|
||||
#### Documentation fixes
|
||||
|
||||
* [#382](https://github.com/chaijs/chai/pull/382) Add doc for showDiff argument in assert.
|
||||
By [@astorije](https://github.com/astorije)
|
||||
* [#383](https://github.com/chaijs/chai/pull/383) Improve wording for truncateTreshold docs
|
||||
By [@gurdiga](https://github.com/gurdiga)
|
||||
* [#381](https://github.com/chaijs/chai/pull/381) Improve wording for assert.empty docs
|
||||
By [@astorije](https://github.com/astorije)
|
||||
|
||||
## 2.1.0 / 2015-02-23
|
||||
|
||||
Small release; fixes an issue where the Chai lib was incorrectly reporting the
|
||||
version number.
|
||||
|
||||
Adds new `should.fail()` and `expect.fail()` methods, which are convinience
|
||||
methods to throw Assertion Errors.
|
||||
|
||||
### Community Contributions
|
||||
|
||||
#### Code Features & Fixes
|
||||
|
||||
* [#356](https://github.com/chaijs/chai/pull/356) Add should.fail(), expect.fail(). By [@Soviut](https://github.com/Soviut)
|
||||
* [#374](https://github.com/chaijs/chai/pull/374) Increment version. By [@jmm](https://github.com/jmm)
|
||||
|
||||
## 2.0.0 / 2015-02-09
|
||||
|
||||
Unfortunately with 1.10.0 - compatibility broke with older versions because of
|
||||
the `addChainableNoop`. This change has been reverted.
|
||||
|
||||
Any plugins using `addChainableNoop` should cease to do so.
|
||||
|
||||
Any developers wishing for this behaviour can use [dirty-chai](https://www.npmjs.com/package/dirty-chai)
|
||||
by [@joshperry](https://github.com/joshperry)
|
||||
|
||||
### Community Contributions
|
||||
|
||||
#### Code Features & Fixes
|
||||
|
||||
* [#361](https://github.com/chaijs/chai/pull/361) `.keys()` now accepts Objects, extracting keys from them. By [@gregglind](https://github.com/gregglind)
|
||||
* [#359](https://github.com/chaijs/chai/pull/359) `.keys()` no longer mutates passed arrays. By [@gregglind](https://github.com/gregglind)
|
||||
* [#349](https://github.com/chaijs/chai/pull/349) Add a new chainable keyword - `.which`. By [@toastynerd](https://github.com/toastynerd)
|
||||
* [#333](https://github.com/chaijs/chai/pull/333) Add `.change`, `.increase` and `.decrease` assertions. By [@cmpolis](https://github.com/cmpolis)
|
||||
* [#335](https://github.com/chaijs/chai/pull/335) `chai.util` is now exposed [@DingoEatingFuzz](https://github.com/DingoEatingFuzz)
|
||||
* [#328](https://github.com/chaijs/chai/pull/328) Add `.includes` and `.contains` aliases (for `.include` and `.contain`). By [@lo1tuma](https://github.com/lo1tuma)
|
||||
* [#313](https://github.com/chaijs/chai/pull/313) Add `.any.keys()` and `.all.keys()` qualifiers. By [@cjqed](https://github.com/cjqed)
|
||||
* [#312](https://github.com/chaijs/chai/pull/312) Add `assert.sameDeepMembers()`. By [@cjqed](https://github.com/cjqed)
|
||||
* [#311](https://github.com/chaijs/chai/pull/311) Add `assert.isAbove()` and `assert.isBelow()`. By [@cjqed](https://github.com/cjqed)
|
||||
* [#308](https://github.com/chaijs/chai/pull/308) `property` and `deep.property` now pass if a value is set to `undefined`. By [@prodatakey](https://github.com/prodatakey)
|
||||
* [#309](https://github.com/chaijs/chai/pull/309) optimize deep equal in Arrays. By [@ericdouglas](https://github.com/ericdouglas)
|
||||
* [#306](https://github.com/chaijs/chai/pull/306) revert #297 - allowing lint-friendly tests. By [@keithamus](https://github.com/keithamus)
|
||||
|
||||
#### Documentation fixes
|
||||
|
||||
* [#357](https://github.com/chaijs/chai/pull/357) Copyright year updated in docs. By [@danilovaz](https://github.com/danilovaz)
|
||||
* [#325](https://github.com/chaijs/chai/pull/325) Fix documentation for overwriteChainableMethod. By [@chasenlehara](https://github.com/chasenlehara)
|
||||
* [#334](https://github.com/chaijs/chai/pull/334) Typo fix. By [@hurrymaplelad](https://github.com/hurrymaplelad)
|
||||
* [#317](https://github.com/chaijs/chai/pull/317) Typo fix. By [@jasonkarns](https://github.com/jasonkarns)
|
||||
* [#318](https://github.com/chaijs/chai/pull/318) Typo fix. By [@jasonkarns](https://github.com/jasonkarns)
|
||||
* [#316](https://github.com/chaijs/chai/pull/316) Typo fix. By [@jasonkarns](https://github.com/jasonkarns)
|
||||
|
||||
|
||||
## 1.10.0 / 2014-11-10
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- No changes required
|
||||
- **Plugin Developers:**
|
||||
- Review `addChainableNoop` notes below.
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated dependencies.
|
||||
|
||||
### Noop Function for Terminating Assertion Properties
|
||||
|
||||
The following assertions can now also be used in the function-call form:
|
||||
|
||||
* ok
|
||||
* true
|
||||
* false
|
||||
* null
|
||||
* undefined
|
||||
* exist
|
||||
* empty
|
||||
* arguments
|
||||
* Arguments
|
||||
|
||||
The above list of assertions are property getters that assert immediately on
|
||||
access. Because of that, they were written to be used by terminating the assertion
|
||||
chain with a property access.
|
||||
|
||||
```js
|
||||
expect(true).to.be.true;
|
||||
foo.should.be.ok;
|
||||
```
|
||||
|
||||
This syntax is definitely aesthetically pleasing but, if you are linting your
|
||||
test code, your linter will complain with an error something like "Expected an
|
||||
assignment or function call and instead saw an expression." Since the linter
|
||||
doesn't know about the property getter it assumes this line has no side-effects,
|
||||
and throws a warning in case you made a mistake.
|
||||
|
||||
Squelching these errors is not a good solution as test code is getting to be
|
||||
just as important as, if not more than, production code. Catching syntactical
|
||||
errors in tests using static analysis is a great tool to help make sure that your
|
||||
tests are well-defined and free of typos.
|
||||
|
||||
A better option was to provide a function-call form for these assertions so that
|
||||
the code's intent is more clear and the linters stop complaining about something
|
||||
looking off. This form is added in addition to the existing property access form
|
||||
and does not impact existing test code.
|
||||
|
||||
```js
|
||||
expect(true).to.be.true();
|
||||
foo.should.be.ok();
|
||||
```
|
||||
|
||||
These forms can also be mixed in any way, these are all functionally identical:
|
||||
|
||||
```js
|
||||
expect(true).to.be.true.and.not.false();
|
||||
expect(true).to.be.true().and.not.false;
|
||||
expect(true).to.be.true.and.not.false;
|
||||
```
|
||||
|
||||
#### Plugin Authors
|
||||
|
||||
If you would like to provide this function-call form for your terminating assertion
|
||||
properties, there is a new function to register these types of asserts. Instead
|
||||
of using `addProperty` to register terminating assertions, simply use `addChainableNoop`
|
||||
instead; the arguments to both are identical. The latter will make the assertion
|
||||
available in both the attribute and function-call forms and should have no impact
|
||||
on existing users of your plugin.
|
||||
|
||||
### Community Contributions
|
||||
|
||||
- [#297](https://github.com/chaijs/chai/pull/297) Allow writing lint-friendly tests. [@joshperry](https://github.com/joshperry)
|
||||
- [#298](https://github.com/chaijs/chai/pull/298) Add check for logging `-0`. [@dasilvacontin](https://github.com/dasilvacontin)
|
||||
- [#300](https://github.com/chaijs/chai/pull/300) Fix #299: the test is defining global variables [@julienw](https://github.com/julienw)
|
||||
|
||||
Thank you to all who took time to contribute!
|
||||
|
||||
## 1.9.2 / 2014-09-29
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- No changes required
|
||||
- **Plugin Developers:**
|
||||
- No changes required
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated dependencies.
|
||||
|
||||
### Community Contributions
|
||||
|
||||
- [#264](https://github.com/chaijs/chai/pull/264) Show diff for keys assertions [@cjthompson](https://github.com/cjthompson)
|
||||
- [#267](https://github.com/chaijs/chai/pull/267) Use SVG badges [@shinnn](https://github.com/shinnn)
|
||||
- [#268](https://github.com/chaijs/chai/pull/268) Allow messages to be functions (sinon-compat) [@charlierudolph](https://github.com/charlierudolph)
|
||||
- [#269](https://github.com/chaijs/chai/pull/269) Remove unused argument for #lengthOf [@charlierudolph](https://github.com/charlierudolph)
|
||||
- [#275](https://github.com/chaijs/chai/pull/275) Rewrite pretty-printing HTML elements to prevent throwing internal errors [@DrRataplan](https://github.com/DrRataplan)
|
||||
- [#277](https://github.com/chaijs/chai/pull/277) Fix assert documentation for #sameMembers [@charlierudolph](https://github.com/charlierudolph)
|
||||
- [#279](https://github.com/chaijs/chai/pull/279) closeTo should check value's type before assertion [@mohayonao](https://github.com/mohayonao)
|
||||
- [#289](https://github.com/chaijs/chai/pull/289) satisfy is called twice [@charlierudolph](https://github.com/charlierudolph)
|
||||
- [#292](https://github.com/chaijs/chai/pull/292) resolve conflicts with node-webkit and global usage [@boneskull](https://github.com/boneskull)
|
||||
|
||||
Thank you to all who took time to contribute!
|
||||
|
||||
## 1.9.1 / 2014-03-19
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- Migrate configuration options to new interface. (see notes)
|
||||
- **Plugin Developers:**
|
||||
- No changes required
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated dependencies.
|
||||
|
||||
### Configuration
|
||||
|
||||
There have been requests for changes and additions to the configuration mechanisms
|
||||
and their impact in the Chai architecture. As such, we have decoupled the
|
||||
configuration from the `Assertion` constructor. This not only allows for centralized
|
||||
configuration, but will allow us to shift the responsibility from the `Assertion`
|
||||
constructor to the `assert` interface in future releases.
|
||||
|
||||
These changes have been implemented in a non-breaking way, but a depretiation
|
||||
warning will be presented to users until they migrate. The old config method will
|
||||
be removed in either `v1.11.0` or `v2.0.0`, whichever comes first.
|
||||
|
||||
#### Quick Migration
|
||||
|
||||
```js
|
||||
// change this:
|
||||
chai.Assertion.includeStack = true;
|
||||
chai.Assertion.showDiff = false;
|
||||
|
||||
// ... to this:
|
||||
chai.config.includeStack = true;
|
||||
chai.config.showDiff = false;
|
||||
```
|
||||
|
||||
#### All Config Options
|
||||
|
||||
##### config.includeStack
|
||||
|
||||
- **@param** _{Boolean}_
|
||||
- **@default** `false`
|
||||
|
||||
User configurable property, influences whether stack trace is included in
|
||||
Assertion error message. Default of `false` suppresses stack trace in the error
|
||||
message.
|
||||
|
||||
##### config.showDiff
|
||||
|
||||
- **@param** _{Boolean}_
|
||||
- **@default** `true`
|
||||
|
||||
User configurable property, influences whether or not the `showDiff` flag
|
||||
should be included in the thrown AssertionErrors. `false` will always be `false`;
|
||||
`true` will be true when the assertion has requested a diff be shown.
|
||||
|
||||
##### config.truncateThreshold **(NEW)**
|
||||
|
||||
- **@param** _{Number}_
|
||||
- **@default** `40`
|
||||
|
||||
User configurable property, sets length threshold for actual and expected values
|
||||
in assertion errors. If this threshold is exceeded, the value is truncated.
|
||||
|
||||
Set it to zero if you want to disable truncating altogether.
|
||||
|
||||
```js
|
||||
chai.config.truncateThreshold = 0; // disable truncating
|
||||
```
|
||||
|
||||
### Community Contributions
|
||||
|
||||
- [#228](https://github.com/chaijs/chai/pull/228) Deep equality check for memebers. [@duncanbeevers](https://github.com/duncanbeevers)
|
||||
- [#247](https://github.com/chaijs/chai/pull/247) Proofreading. [@didorellano](https://github.com/didoarellano)
|
||||
- [#244](https://github.com/chaijs/chai/pull/244) Fix `contain`/`include` 1.9.0 regression. [@leider](https://github.com/leider)
|
||||
- [#233](https://github.com/chaijs/chai/pull/233) Improvements to `ssfi` for `assert` interface. [@refack](https://github.com/refack)
|
||||
- [#251](https://github.com/chaijs/chai/pull/251) New config option: object display threshold. [@romario333](https://github.com/romario333)
|
||||
|
||||
Thank you to all who took time to contribute!
|
||||
|
||||
### Other Bug Fixes
|
||||
|
||||
- [#183](https://github.com/chaijs/chai/issues/183) Allow `undefined` for actual. (internal api)
|
||||
- Update Karam(+plugins)/Istanbul to most recent versions.
|
||||
|
||||
## 1.9.0 / 2014-01-29
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- No changes required
|
||||
- **Plugin Developers:**
|
||||
- Review [#219](https://github.com/chaijs/chai/pull/219).
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated dependencies.
|
||||
|
||||
### Community Contributions
|
||||
|
||||
- [#202](https://github.com/chaijs/chai/pull/201) Improve error message for .throw(). [@andreineculau](https://github.com/andreineculau)
|
||||
- [#217](https://github.com/chaijs/chai/pull/217) Chai tests can be run with `--watch`. [@demands](https://github.com/demands)
|
||||
- [#219](https://github.com/chaijs/chai/pull/219) Add overwriteChainableMethod utility. [@demands](https://github.com/demands)
|
||||
- [#224](https://github.com/chaijs/chai/pull/224) Return error on throw method to chain on error properties. [@vbardales](https://github.com/vbardales)
|
||||
- [#226](https://github.com/chaijs/chai/pull/226) Add `has` to language chains. [@duncanbeevers](https://github.com/duncanbeevers)
|
||||
- [#230](https://github.com/chaijs/chai/pull/230) Support `{a:1,b:2}.should.include({a:1})` [@jkroso](https://github.com/jkroso)
|
||||
- [#231](https://github.com/chaijs/chai/pull/231) Update Copyright notices to 2014 [@duncanbeevers](https://github.com/duncanbeevers)
|
||||
- [#232](https://github.com/chaijs/chai/pull/232) Avoid error instantiation if possible on assert.throws. [@laconbass](https://github.com/laconbass)
|
||||
|
||||
Thank you to all who took time to contribute!
|
||||
|
||||
### Other Bug Fixes
|
||||
|
||||
- [#225](https://github.com/chaijs/chai/pull/225) Improved AMD wrapper provided by upstream `component(1)`.
|
||||
- [#185](https://github.com/chaijs/chai/issues/185) `assert.throws()` returns thrown error for further assertions.
|
||||
- [#237](https://github.com/chaijs/chai/pull/237) Remove coveralls/jscoverage, include istanbul coverage report in travis test.
|
||||
- Update Karma and Sauce runner versions for consistent CI results. No more karma@canary.
|
||||
|
||||
## 1.8.1 / 2013-10-10
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- Refresh `node_modules` folder for updated dependencies.
|
||||
- **Plugin Developers:**
|
||||
- No changes required
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated dependencies.
|
||||
|
||||
### Browserify
|
||||
|
||||
This is a small patch that updates the dependency tree so browserify users can install
|
||||
chai. (Remove conditional requires)
|
||||
|
||||
## 1.8.0 / 2013-09-18
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- See `deep.equal` notes.
|
||||
- **Plugin Developers:**
|
||||
- No changes required
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated dependencies.
|
||||
|
||||
### Deep Equals
|
||||
|
||||
This version of Chai focused on a overhaul to the deep equal utility. The code for this
|
||||
tool has been removed from the core lib and can now be found at:
|
||||
[chai / deep-eql](https://github.com/chaijs/deep-eql). As stated in previous releases,
|
||||
this is part of a larger initiative to provide transparency, independent testing, and coverage for
|
||||
some of the more complicated internal tools.
|
||||
|
||||
For the most part `.deep.equal` will behave the same as it has. However, in order to provide a
|
||||
consistent ruleset across all types being tested, the following changes have been made and _might_
|
||||
require changes to your tests.
|
||||
|
||||
**1.** Strict equality for non-traversable nodes according to [egal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).
|
||||
|
||||
_Previously:_ Non-traversable equal via `===`.
|
||||
|
||||
```js
|
||||
expect(NaN).to.deep.equal(NaN);
|
||||
expect(-0).to.not.deep.equal(+0);
|
||||
```
|
||||
|
||||
**2.** Arguments are not Arrays (and all types must be equal):
|
||||
|
||||
_Previously:_ Some crazy nonsense that led to empty arrays deep equaling empty objects deep equaling dates.
|
||||
|
||||
```js
|
||||
expect(arguments).to.not.deep.equal([]);
|
||||
expect(Array.prototype.slice.call(arguments)).to.deep.equal([]);
|
||||
```
|
||||
|
||||
- [#156](https://github.com/chaijs/chai/issues/156) Empty object is eql to empty array
|
||||
- [#192](https://github.com/chaijs/chai/issues/192) empty object is eql to a Date object
|
||||
- [#194](https://github.com/chaijs/chai/issues/194) refactor deep-equal utility
|
||||
|
||||
### CI and Browser Testing
|
||||
|
||||
Chai now runs the browser CI suite using [Karma](http://karma-runner.github.io/) directed at
|
||||
[SauceLabs](https://saucelabs.com/). This means we get to know where our browser support stands...
|
||||
and we get a cool badge:
|
||||
|
||||
[](https://saucelabs.com/u/logicalparadox)
|
||||
|
||||
Look for the list of browsers/versions to expand over the coming releases.
|
||||
|
||||
- [#195](https://github.com/chaijs/chai/issues/195) karma test framework
|
||||
|
||||
## 1.7.2 / 2013-06-27
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- No changes required.
|
||||
- **Plugin Developers:**
|
||||
- No changes required
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated dependencies.
|
||||
|
||||
### Coverage Reporting
|
||||
|
||||
Coverage reporting has always been available for core-developers but the data has never been published
|
||||
for our end users. In our ongoing effort to improve accountability this data will now be published via
|
||||
the [coveralls.io](https://coveralls.io/) service. A badge has been added to the README and the full report
|
||||
can be viewed online at the [chai coveralls project](https://coveralls.io/r/chaijs/chai). Furthermore, PRs
|
||||
will receive automated messages indicating how their PR impacts test coverage. This service is tied to TravisCI.
|
||||
|
||||
### Other Fixes
|
||||
|
||||
- [#175](https://github.com/chaijs/chai/issues/175) Add `bower.json`. (Fix ignore all)
|
||||
|
||||
## 1.7.1 / 2013-06-24
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- No changes required.
|
||||
- **Plugin Developers:**
|
||||
- No changes required
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated dependencies.
|
||||
|
||||
### Official Bower Support
|
||||
|
||||
Support has been added for the Bower Package Manager ([bower.io])(http://bower.io/). Though
|
||||
Chai could be installed via Bower in the past, this update adds official support via the `bower.json`
|
||||
specification file.
|
||||
|
||||
- [#175](https://github.com/chaijs/chai/issues/175) Add `bower.json`.
|
||||
|
||||
## 1.7.0 / 2013-06-17
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- No changes required.
|
||||
- **Plugin Developers:**
|
||||
- Review AssertionError update notice.
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated dependencies.
|
||||
|
||||
### AssertionError Update Notice
|
||||
|
||||
Chai now uses [chaijs/assertion-error](https://github.com/chaijs/assertion-error) instead an internal
|
||||
constructor. This will allow for further iteration/experimentation of the AssertionError constructor
|
||||
independant of Chai. Future plans include stack parsing for callsite support.
|
||||
|
||||
This update constructor has a different constructor param signature that conforms more with the standard
|
||||
`Error` object. If your plugin throws and `AssertionError` directly you will need to update your plugin
|
||||
with the new signature.
|
||||
|
||||
```js
|
||||
var AssertionError = require('chai').AssertionError;
|
||||
|
||||
/**
|
||||
* previous
|
||||
*
|
||||
* @param {Object} options
|
||||
*/
|
||||
|
||||
throw new AssertionError({
|
||||
message: 'An assertion error occurred'
|
||||
, actual: actual
|
||||
, expect: expect
|
||||
, startStackFunction: arguments.callee
|
||||
, showStack: true
|
||||
});
|
||||
|
||||
/**
|
||||
* new
|
||||
*
|
||||
* @param {String} message
|
||||
* @param {Object} options
|
||||
* @param {Function} start stack function
|
||||
*/
|
||||
|
||||
throw new AssertionError('An assertion error occurred', {
|
||||
actual: actual
|
||||
, expect: expect
|
||||
, showStack: true
|
||||
}, arguments.callee);
|
||||
|
||||
// other signatures
|
||||
throw new AssertionError('An assertion error occurred');
|
||||
throw new AssertionError('An assertion error occurred', null, arguments.callee);
|
||||
```
|
||||
|
||||
#### External Dependencies
|
||||
|
||||
This is the first non-developement dependency for Chai. As Chai continues to evolve we will begin adding
|
||||
more; the next will likely be improved type detection and deep equality. With Chai's userbase continually growing
|
||||
there is an higher need for accountability and documentation. External dependencies will allow us to iterate and
|
||||
test on features independent from our interfaces.
|
||||
|
||||
Note: The browser packaged version `chai.js` will ALWAYS contain all dependencies needed to run Chai.
|
||||
|
||||
### Community Contributions
|
||||
|
||||
- [#169](https://github.com/chaijs/chai/pull/169) Fix deep equal comparison for Date/Regexp types. [@katsgeorgeek](https://github.com/katsgeorgeek)
|
||||
- [#171](https://github.com/chaijs/chai/pull/171) Add `assert.notOk()`. [@Bartvds](https://github.com/Bartvds)
|
||||
- [#173](https://github.com/chaijs/chai/pull/173) Fix `inspect` utility. [@domenic](https://github.com/domenic)
|
||||
|
||||
Thank you to all who took the time to contribute!
|
||||
|
||||
## 1.6.1 / 2013-06-05
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- No changes required.
|
||||
- **Plugin Developers:**
|
||||
- No changes required.
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated developement dependencies.
|
||||
|
||||
### Deep Equality
|
||||
|
||||
Regular Expressions are now tested as part of all deep equality assertions. In previous versions
|
||||
they silently passed for all scenarios. Thanks to [@katsgeorgeek](https://github.com/katsgeorgeek) for the contribution.
|
||||
|
||||
### Community Contributions
|
||||
|
||||
- [#161](https://github.com/chaijs/chai/pull/161) Fix documented name for assert interface's isDefined method. [@brandonpayton](https://github.com/brandonpayton)
|
||||
- [#168](https://github.com/chaijs/chai/pull/168) Fix comparison equality of two regexps for when using deep equality. [@katsgeorgeek](https://github.com/katsgeorgeek)
|
||||
|
||||
Thank you to all who took the time to contribute!
|
||||
|
||||
### Additional Notes
|
||||
|
||||
- Mocha has been locked at version `1.8.x` to ensure `mocha-phantomjs` compatibility.
|
||||
|
||||
## 1.6.0 / 2013-04-29
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- No changes required.
|
||||
- **Plugin Developers:**
|
||||
- No changes required.
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated developement dependencies.
|
||||
|
||||
### New Assertions
|
||||
|
||||
#### Array Members Inclusion
|
||||
|
||||
Asserts that the target is a superset of `set`, or that the target and `set` have the same members.
|
||||
Order is not taken into account. Thanks to [@NickHeiner](https://github.com/NickHeiner) for the contribution.
|
||||
|
||||
```js
|
||||
// (expect/should) full set
|
||||
expect([4, 2]).to.have.members([2, 4]);
|
||||
expect([5, 2]).to.not.have.members([5, 2, 1]);
|
||||
|
||||
// (expect/should) inclusion
|
||||
expect([1, 2, 3]).to.include.members([3, 2]);
|
||||
expect([1, 2, 3]).to.not.include.members([3, 2, 8]);
|
||||
|
||||
// (assert) full set
|
||||
assert.sameMembers([ 1, 2, 3 ], [ 2, 1, 3 ], 'same members');
|
||||
|
||||
// (assert) inclusion
|
||||
assert.includeMembers([ 1, 2, 3 ], [ 2, 1 ], 'include members');
|
||||
|
||||
```
|
||||
|
||||
#### Non-inclusion for Assert Interface
|
||||
|
||||
Most `assert` functions have a negative version, like `instanceOf()` has a corresponding `notInstaceOf()`.
|
||||
However `include()` did not have a corresponding `notInclude()`. This has been added.
|
||||
|
||||
```js
|
||||
assert.notInclude([ 1, 2, 3 ], 8);
|
||||
assert.notInclude('foobar', 'baz');
|
||||
```
|
||||
|
||||
### Community Contributions
|
||||
|
||||
- [#140](https://github.com/chaijs/chai/pull/140) Restore `call`/`apply` methods for plugin interface. [@RubenVerborgh](https://github.com/RubenVerborgh)
|
||||
- [#148](https://github.com/chaijs/chai/issues/148)/[#153](https://github.com/chaijs/chai/pull/153) Add `members` and `include.members` assertions. [#NickHeiner](https://github.com/NickHeiner)
|
||||
|
||||
Thank you to all who took time to contribute!
|
||||
|
||||
### Other Bug Fixes
|
||||
|
||||
- [#142](https://github.com/chaijs/chai/issues/142) `assert#include` will no longer silently pass on wrong-type haystack.
|
||||
- [#158](https://github.com/chaijs/chai/issues/158) `assert#notInclude` has been added.
|
||||
- Travis-CI now tests Node.js `v0.10.x`. Support for `v0.6.x` has been removed. `v0.8.x` is still tested as before.
|
||||
|
||||
## 1.5.0 / 2013-02-03
|
||||
|
||||
### Migration Requirements
|
||||
|
||||
The following changes are required if you are upgrading from the previous version:
|
||||
|
||||
- **Users:**
|
||||
- _Update [2013-02-04]:_ Some users may notice a small subset of deep equality assertions will no longer pass. This is the result of
|
||||
[#120](https://github.com/chaijs/chai/issues/120), an improvement to our deep equality algorithm. Users will need to revise their assertions
|
||||
to be more granular should this occur. Further information: [#139](https://github.com/chaijs/chai/issues/139).
|
||||
- **Plugin Developers:**
|
||||
- No changes required.
|
||||
- **Core Contributors:**
|
||||
- Refresh `node_modules` folder for updated developement dependencies.
|
||||
|
||||
### Community Contributions
|
||||
|
||||
- [#126](https://github.com/chaijs/chai/pull/126): Add `eqls` alias for `eql`. [@RubenVerborgh](https://github.com/RubenVerborgh)
|
||||
- [#127](https://github.com/chaijs/chai/issues/127): Performance refactor for chainable methods. [@RubenVerborgh](https://github.com/RubenVerborgh)
|
||||
- [#133](https://github.com/chaijs/chai/pull/133): Assertion `.throw` support for primitives. [@RubenVerborgh](https://github.com/RubenVerborgh)
|
||||
- [#137](https://github.com/chaijs/chai/issues/137): Assertion `.throw` support for empty messages. [@timnew](https://github.com/timnew)
|
||||
- [#136](https://github.com/chaijs/chai/pull/136): Fix backward negation messages when using `.above()` and `.below()`. [@whatthejeff](https://github.com/whatthejeff)
|
||||
|
||||
Thank you to all who took time to contribute!
|
||||
|
||||
### Other Bug Fixes
|
||||
|
||||
- Improve type detection of `.a()`/`.an()` to work in cross-browser scenarios.
|
||||
- [#116](https://github.com/chaijs/chai/issues/116): `.throw()` has cleaner display of errors when WebKit browsers.
|
||||
- [#120](https://github.com/chaijs/chai/issues/120): `.eql()` now works to compare dom nodes in browsers.
|
||||
|
||||
|
||||
### Usage Updates
|
||||
|
||||
#### For Users
|
||||
|
||||
**1. Component Support:** Chai now included the proper configuration to be installed as a
|
||||
[component](https://github.com/component/component). Component users are encouraged to consult
|
||||
[chaijs.com](http://chaijs.com) for the latest version number as using the master branch
|
||||
does not gaurantee stability.
|
||||
|
||||
```js
|
||||
// relevant component.json
|
||||
devDependencies: {
|
||||
"chaijs/chai": "1.5.0"
|
||||
}
|
||||
```
|
||||
|
||||
Alternatively, bleeding-edge is available:
|
||||
|
||||
$ component install chaijs/chai
|
||||
|
||||
**2. Configurable showDiff:** Some test runners (such as [mocha](http://visionmedia.github.com/mocha/))
|
||||
include support for showing the diff of strings and objects when an equality error occurs. Chai has
|
||||
already included support for this, however some users may not prefer this display behavior. To revert to
|
||||
no diff display, the following configuration is available:
|
||||
|
||||
```js
|
||||
chai.Assertion.showDiff = false; // diff output disabled
|
||||
chai.Assertion.showDiff = true; // default, diff output enabled
|
||||
```
|
||||
|
||||
#### For Plugin Developers
|
||||
|
||||
**1. New Utility - type**: The new utility `.type()` is available as a better implementation of `typeof`
|
||||
that can be used cross-browser. It handles the inconsistencies of Array, `null`, and `undefined` detection.
|
||||
|
||||
- **@param** _{Mixed}_ object to detect type of
|
||||
- **@return** _{String}_ object type
|
||||
|
||||
```js
|
||||
chai.use(function (c, utils) {
|
||||
// some examples
|
||||
utils.type({}); // 'object'
|
||||
utils.type(null); // `null'
|
||||
utils.type(undefined); // `undefined`
|
||||
utils.type([]); // `array`
|
||||
});
|
||||
```
|
||||
|
||||
#### For Core Contributors
|
||||
|
||||
**1. Browser Testing**: Browser testing of the `./chai.js` file is now available in the command line
|
||||
via PhantomJS. `make test` and Travis-CI will now also rebuild and test `./chai.js`. Consequently, all
|
||||
pull requests will now be browser tested in this way.
|
||||
|
||||
_Note: Contributors opening pull requests should still NOT include the browser build._
|
||||
|
||||
**2. SauceLabs Testing**: Early SauceLab support has been enabled with the file `./support/mocha-cloud.js`.
|
||||
Those interested in trying it out should create a free [Open Sauce](https://saucelabs.com/signup/plan) account
|
||||
and include their credentials in `./test/auth/sauce.json`.
|
26
node_modules/chai/bower.json
generated
vendored
Normal file
26
node_modules/chai/bower.json
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
{
|
||||
"name": "chai",
|
||||
"description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.",
|
||||
"license": "MIT",
|
||||
"keywords": [
|
||||
"test",
|
||||
"assertion",
|
||||
"assert",
|
||||
"testing",
|
||||
"chai"
|
||||
],
|
||||
"main": "chai.js",
|
||||
"ignore": [
|
||||
"build",
|
||||
"components",
|
||||
"lib",
|
||||
"node_modules",
|
||||
"support",
|
||||
"test",
|
||||
"index.js",
|
||||
"Makefile",
|
||||
".*"
|
||||
],
|
||||
"dependencies": {},
|
||||
"devDependencies": {}
|
||||
}
|
10854
node_modules/chai/chai.js
generated
vendored
Normal file
10854
node_modules/chai/chai.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
node_modules/chai/index.js
generated
vendored
Normal file
1
node_modules/chai/index.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
module.exports = require('./lib/chai');
|
28
node_modules/chai/karma.conf.js
generated
vendored
Normal file
28
node_modules/chai/karma.conf.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
module.exports = function(config) {
|
||||
config.set({
|
||||
frameworks: [ 'mocha' ]
|
||||
, files: [
|
||||
'chai.js'
|
||||
, 'test/bootstrap/index.js'
|
||||
, 'test/*.js'
|
||||
]
|
||||
, reporters: [ 'progress' ]
|
||||
, colors: true
|
||||
, logLevel: config.LOG_INFO
|
||||
, autoWatch: false
|
||||
, browsers: [ 'PhantomJS' ]
|
||||
, browserDisconnectTimeout: 10000
|
||||
, browserDisconnectTolerance: 2
|
||||
, browserNoActivityTimeout: 20000
|
||||
, singleRun: true
|
||||
});
|
||||
|
||||
switch (process.env.CHAI_TEST_ENV) {
|
||||
case 'sauce':
|
||||
require('./karma.sauce')(config);
|
||||
break;
|
||||
default:
|
||||
// ...
|
||||
break;
|
||||
};
|
||||
};
|
41
node_modules/chai/karma.sauce.js
generated
vendored
Normal file
41
node_modules/chai/karma.sauce.js
generated
vendored
Normal file
@ -0,0 +1,41 @@
|
||||
var version = require('./package.json').version;
|
||||
var ts = new Date().getTime();
|
||||
|
||||
module.exports = function(config) {
|
||||
var auth;
|
||||
|
||||
try {
|
||||
auth = require('./test/auth/index');
|
||||
} catch(ex) {
|
||||
auth = {};
|
||||
auth.SAUCE_USERNAME = process.env.SAUCE_USERNAME || null;
|
||||
auth.SAUCE_ACCESS_KEY = process.env.SAUCE_ACCESS_KEY || null;
|
||||
}
|
||||
|
||||
if (!auth.SAUCE_USERNAME || !auth.SAUCE_ACCESS_KEY) return;
|
||||
if (process.env.SKIP_SAUCE) return;
|
||||
|
||||
var branch = process.env.TRAVIS_BRANCH || 'local'
|
||||
var browserConfig = require('./sauce.browsers');
|
||||
var browsers = Object.keys(browserConfig);
|
||||
var tags = [ 'chaijs_' + version, auth.SAUCE_USERNAME + '@' + branch ];
|
||||
var tunnel = process.env.TRAVIS_JOB_NUMBER || ts;
|
||||
|
||||
if (process.env.TRAVIS_JOB_NUMBER) {
|
||||
tags.push('travis@' + process.env.TRAVIS_JOB_NUMBER);
|
||||
}
|
||||
|
||||
config.browsers = config.browsers.concat(browsers);
|
||||
config.customLaunchers = browserConfig;
|
||||
config.reporters.push('saucelabs');
|
||||
config.captureTimeout = 300000;
|
||||
|
||||
config.sauceLabs = {
|
||||
username: auth.SAUCE_USERNAME
|
||||
, accessKey: auth.SAUCE_ACCESS_KEY
|
||||
, startConnect: ('TRAVIS' in process.env) === false
|
||||
, tags: tags
|
||||
, testName: 'ChaiJS'
|
||||
, tunnelIdentifier: tunnel
|
||||
};
|
||||
};
|
92
node_modules/chai/lib/chai.js
generated
vendored
Normal file
92
node_modules/chai/lib/chai.js
generated
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
/*!
|
||||
* chai
|
||||
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
var used = [];
|
||||
|
||||
/*!
|
||||
* Chai version
|
||||
*/
|
||||
|
||||
exports.version = '4.2.0';
|
||||
|
||||
/*!
|
||||
* Assertion Error
|
||||
*/
|
||||
|
||||
exports.AssertionError = require('assertion-error');
|
||||
|
||||
/*!
|
||||
* Utils for plugins (not exported)
|
||||
*/
|
||||
|
||||
var util = require('./chai/utils');
|
||||
|
||||
/**
|
||||
* # .use(function)
|
||||
*
|
||||
* Provides a way to extend the internals of Chai.
|
||||
*
|
||||
* @param {Function}
|
||||
* @returns {this} for chaining
|
||||
* @api public
|
||||
*/
|
||||
|
||||
exports.use = function (fn) {
|
||||
if (!~used.indexOf(fn)) {
|
||||
fn(exports, util);
|
||||
used.push(fn);
|
||||
}
|
||||
|
||||
return exports;
|
||||
};
|
||||
|
||||
/*!
|
||||
* Utility Functions
|
||||
*/
|
||||
|
||||
exports.util = util;
|
||||
|
||||
/*!
|
||||
* Configuration
|
||||
*/
|
||||
|
||||
var config = require('./chai/config');
|
||||
exports.config = config;
|
||||
|
||||
/*!
|
||||
* Primary `Assertion` prototype
|
||||
*/
|
||||
|
||||
var assertion = require('./chai/assertion');
|
||||
exports.use(assertion);
|
||||
|
||||
/*!
|
||||
* Core Assertions
|
||||
*/
|
||||
|
||||
var core = require('./chai/core/assertions');
|
||||
exports.use(core);
|
||||
|
||||
/*!
|
||||
* Expect interface
|
||||
*/
|
||||
|
||||
var expect = require('./chai/interface/expect');
|
||||
exports.use(expect);
|
||||
|
||||
/*!
|
||||
* Should interface
|
||||
*/
|
||||
|
||||
var should = require('./chai/interface/should');
|
||||
exports.use(should);
|
||||
|
||||
/*!
|
||||
* Assert interface
|
||||
*/
|
||||
|
||||
var assert = require('./chai/interface/assert');
|
||||
exports.use(assert);
|
165
node_modules/chai/lib/chai/assertion.js
generated
vendored
Normal file
165
node_modules/chai/lib/chai/assertion.js
generated
vendored
Normal file
@ -0,0 +1,165 @@
|
||||
/*!
|
||||
* chai
|
||||
* http://chaijs.com
|
||||
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
var config = require('./config');
|
||||
|
||||
module.exports = function (_chai, util) {
|
||||
/*!
|
||||
* Module dependencies.
|
||||
*/
|
||||
|
||||
var AssertionError = _chai.AssertionError
|
||||
, flag = util.flag;
|
||||
|
||||
/*!
|
||||
* Module export.
|
||||
*/
|
||||
|
||||
_chai.Assertion = Assertion;
|
||||
|
||||
/*!
|
||||
* Assertion Constructor
|
||||
*
|
||||
* Creates object for chaining.
|
||||
*
|
||||
* `Assertion` objects contain metadata in the form of flags. Three flags can
|
||||
* be assigned during instantiation by passing arguments to this constructor:
|
||||
*
|
||||
* - `object`: This flag contains the target of the assertion. For example, in
|
||||
* the assertion `expect(numKittens).to.equal(7);`, the `object` flag will
|
||||
* contain `numKittens` so that the `equal` assertion can reference it when
|
||||
* needed.
|
||||
*
|
||||
* - `message`: This flag contains an optional custom error message to be
|
||||
* prepended to the error message that's generated by the assertion when it
|
||||
* fails.
|
||||
*
|
||||
* - `ssfi`: This flag stands for "start stack function indicator". It
|
||||
* contains a function reference that serves as the starting point for
|
||||
* removing frames from the stack trace of the error that's created by the
|
||||
* assertion when it fails. The goal is to provide a cleaner stack trace to
|
||||
* end users by removing Chai's internal functions. Note that it only works
|
||||
* in environments that support `Error.captureStackTrace`, and only when
|
||||
* `Chai.config.includeStack` hasn't been set to `false`.
|
||||
*
|
||||
* - `lockSsfi`: This flag controls whether or not the given `ssfi` flag
|
||||
* should retain its current value, even as assertions are chained off of
|
||||
* this object. This is usually set to `true` when creating a new assertion
|
||||
* from within another assertion. It's also temporarily set to `true` before
|
||||
* an overwritten assertion gets called by the overwriting assertion.
|
||||
*
|
||||
* @param {Mixed} obj target of the assertion
|
||||
* @param {String} msg (optional) custom error message
|
||||
* @param {Function} ssfi (optional) starting point for removing stack frames
|
||||
* @param {Boolean} lockSsfi (optional) whether or not the ssfi flag is locked
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function Assertion (obj, msg, ssfi, lockSsfi) {
|
||||
flag(this, 'ssfi', ssfi || Assertion);
|
||||
flag(this, 'lockSsfi', lockSsfi);
|
||||
flag(this, 'object', obj);
|
||||
flag(this, 'message', msg);
|
||||
|
||||
return util.proxify(this);
|
||||
}
|
||||
|
||||
Object.defineProperty(Assertion, 'includeStack', {
|
||||
get: function() {
|
||||
console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.');
|
||||
return config.includeStack;
|
||||
},
|
||||
set: function(value) {
|
||||
console.warn('Assertion.includeStack is deprecated, use chai.config.includeStack instead.');
|
||||
config.includeStack = value;
|
||||
}
|
||||
});
|
||||
|
||||
Object.defineProperty(Assertion, 'showDiff', {
|
||||
get: function() {
|
||||
console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.');
|
||||
return config.showDiff;
|
||||
},
|
||||
set: function(value) {
|
||||
console.warn('Assertion.showDiff is deprecated, use chai.config.showDiff instead.');
|
||||
config.showDiff = value;
|
||||
}
|
||||
});
|
||||
|
||||
Assertion.addProperty = function (name, fn) {
|
||||
util.addProperty(this.prototype, name, fn);
|
||||
};
|
||||
|
||||
Assertion.addMethod = function (name, fn) {
|
||||
util.addMethod(this.prototype, name, fn);
|
||||
};
|
||||
|
||||
Assertion.addChainableMethod = function (name, fn, chainingBehavior) {
|
||||
util.addChainableMethod(this.prototype, name, fn, chainingBehavior);
|
||||
};
|
||||
|
||||
Assertion.overwriteProperty = function (name, fn) {
|
||||
util.overwriteProperty(this.prototype, name, fn);
|
||||
};
|
||||
|
||||
Assertion.overwriteMethod = function (name, fn) {
|
||||
util.overwriteMethod(this.prototype, name, fn);
|
||||
};
|
||||
|
||||
Assertion.overwriteChainableMethod = function (name, fn, chainingBehavior) {
|
||||
util.overwriteChainableMethod(this.prototype, name, fn, chainingBehavior);
|
||||
};
|
||||
|
||||
/**
|
||||
* ### .assert(expression, message, negateMessage, expected, actual, showDiff)
|
||||
*
|
||||
* Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass.
|
||||
*
|
||||
* @name assert
|
||||
* @param {Philosophical} expression to be tested
|
||||
* @param {String|Function} message or function that returns message to display if expression fails
|
||||
* @param {String|Function} negatedMessage or function that returns negatedMessage to display if negated expression fails
|
||||
* @param {Mixed} expected value (remember to check for negation)
|
||||
* @param {Mixed} actual (optional) will default to `this.obj`
|
||||
* @param {Boolean} showDiff (optional) when set to `true`, assert will display a diff in addition to the message if expression fails
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Assertion.prototype.assert = function (expr, msg, negateMsg, expected, _actual, showDiff) {
|
||||
var ok = util.test(this, arguments);
|
||||
if (false !== showDiff) showDiff = true;
|
||||
if (undefined === expected && undefined === _actual) showDiff = false;
|
||||
if (true !== config.showDiff) showDiff = false;
|
||||
|
||||
if (!ok) {
|
||||
msg = util.getMessage(this, arguments);
|
||||
var actual = util.getActual(this, arguments);
|
||||
throw new AssertionError(msg, {
|
||||
actual: actual
|
||||
, expected: expected
|
||||
, showDiff: showDiff
|
||||
}, (config.includeStack) ? this.assert : flag(this, 'ssfi'));
|
||||
}
|
||||
};
|
||||
|
||||
/*!
|
||||
* ### ._obj
|
||||
*
|
||||
* Quick reference to stored `actual` value for plugin developers.
|
||||
*
|
||||
* @api private
|
||||
*/
|
||||
|
||||
Object.defineProperty(Assertion.prototype, '_obj',
|
||||
{ get: function () {
|
||||
return flag(this, 'object');
|
||||
}
|
||||
, set: function (val) {
|
||||
flag(this, 'object', val);
|
||||
}
|
||||
});
|
||||
};
|
94
node_modules/chai/lib/chai/config.js
generated
vendored
Normal file
94
node_modules/chai/lib/chai/config.js
generated
vendored
Normal file
@ -0,0 +1,94 @@
|
||||
module.exports = {
|
||||
|
||||
/**
|
||||
* ### config.includeStack
|
||||
*
|
||||
* User configurable property, influences whether stack trace
|
||||
* is included in Assertion error message. Default of false
|
||||
* suppresses stack trace in the error message.
|
||||
*
|
||||
* chai.config.includeStack = true; // enable stack on error
|
||||
*
|
||||
* @param {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
includeStack: false,
|
||||
|
||||
/**
|
||||
* ### config.showDiff
|
||||
*
|
||||
* User configurable property, influences whether or not
|
||||
* the `showDiff` flag should be included in the thrown
|
||||
* AssertionErrors. `false` will always be `false`; `true`
|
||||
* will be true when the assertion has requested a diff
|
||||
* be shown.
|
||||
*
|
||||
* @param {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
showDiff: true,
|
||||
|
||||
/**
|
||||
* ### config.truncateThreshold
|
||||
*
|
||||
* User configurable property, sets length threshold for actual and
|
||||
* expected values in assertion errors. If this threshold is exceeded, for
|
||||
* example for large data structures, the value is replaced with something
|
||||
* like `[ Array(3) ]` or `{ Object (prop1, prop2) }`.
|
||||
*
|
||||
* Set it to zero if you want to disable truncating altogether.
|
||||
*
|
||||
* This is especially userful when doing assertions on arrays: having this
|
||||
* set to a reasonable large value makes the failure messages readily
|
||||
* inspectable.
|
||||
*
|
||||
* chai.config.truncateThreshold = 0; // disable truncating
|
||||
*
|
||||
* @param {Number}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
truncateThreshold: 40,
|
||||
|
||||
/**
|
||||
* ### config.useProxy
|
||||
*
|
||||
* User configurable property, defines if chai will use a Proxy to throw
|
||||
* an error when a non-existent property is read, which protects users
|
||||
* from typos when using property-based assertions.
|
||||
*
|
||||
* Set it to false if you want to disable this feature.
|
||||
*
|
||||
* chai.config.useProxy = false; // disable use of Proxy
|
||||
*
|
||||
* This feature is automatically disabled regardless of this config value
|
||||
* in environments that don't support proxies.
|
||||
*
|
||||
* @param {Boolean}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
useProxy: true,
|
||||
|
||||
/**
|
||||
* ### config.proxyExcludedKeys
|
||||
*
|
||||
* User configurable property, defines which properties should be ignored
|
||||
* instead of throwing an error if they do not exist on the assertion.
|
||||
* This is only applied if the environment Chai is running in supports proxies and
|
||||
* if the `useProxy` configuration setting is enabled.
|
||||
* By default, `then` and `inspect` will not throw an error if they do not exist on the
|
||||
* assertion object because the `.inspect` property is read by `util.inspect` (for example, when
|
||||
* using `console.log` on the assertion object) and `.then` is necessary for promise type-checking.
|
||||
*
|
||||
* // By default these keys will not throw an error if they do not exist on the assertion object
|
||||
* chai.config.proxyExcludedKeys = ['then', 'inspect'];
|
||||
*
|
||||
* @param {Array}
|
||||
* @api public
|
||||
*/
|
||||
|
||||
proxyExcludedKeys: ['then', 'catch', 'inspect', 'toJSON']
|
||||
};
|
3804
node_modules/chai/lib/chai/core/assertions.js
generated
vendored
Normal file
3804
node_modules/chai/lib/chai/core/assertions.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
3113
node_modules/chai/lib/chai/interface/assert.js
generated
vendored
Normal file
3113
node_modules/chai/lib/chai/interface/assert.js
generated
vendored
Normal file
File diff suppressed because it is too large
Load Diff
47
node_modules/chai/lib/chai/interface/expect.js
generated
vendored
Normal file
47
node_modules/chai/lib/chai/interface/expect.js
generated
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
/*!
|
||||
* chai
|
||||
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
module.exports = function (chai, util) {
|
||||
chai.expect = function (val, message) {
|
||||
return new chai.Assertion(val, message);
|
||||
};
|
||||
|
||||
/**
|
||||
* ### .fail([message])
|
||||
* ### .fail(actual, expected, [message], [operator])
|
||||
*
|
||||
* Throw a failure.
|
||||
*
|
||||
* expect.fail();
|
||||
* expect.fail("custom error message");
|
||||
* expect.fail(1, 2);
|
||||
* expect.fail(1, 2, "custom error message");
|
||||
* expect.fail(1, 2, "custom error message", ">");
|
||||
* expect.fail(1, 2, undefined, ">");
|
||||
*
|
||||
* @name fail
|
||||
* @param {Mixed} actual
|
||||
* @param {Mixed} expected
|
||||
* @param {String} message
|
||||
* @param {String} operator
|
||||
* @namespace BDD
|
||||
* @api public
|
||||
*/
|
||||
|
||||
chai.expect.fail = function (actual, expected, message, operator) {
|
||||
if (arguments.length < 2) {
|
||||
message = actual;
|
||||
actual = undefined;
|
||||
}
|
||||
|
||||
message = message || 'expect.fail()';
|
||||
throw new chai.AssertionError(message, {
|
||||
actual: actual
|
||||
, expected: expected
|
||||
, operator: operator
|
||||
}, chai.expect.fail);
|
||||
};
|
||||
};
|
218
node_modules/chai/lib/chai/interface/should.js
generated
vendored
Normal file
218
node_modules/chai/lib/chai/interface/should.js
generated
vendored
Normal file
@ -0,0 +1,218 @@
|
||||
/*!
|
||||
* chai
|
||||
* Copyright(c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
module.exports = function (chai, util) {
|
||||
var Assertion = chai.Assertion;
|
||||
|
||||
function loadShould () {
|
||||
// explicitly define this method as function as to have it's name to include as `ssfi`
|
||||
function shouldGetter() {
|
||||
if (this instanceof String
|
||||
|| this instanceof Number
|
||||
|| this instanceof Boolean
|
||||
|| typeof Symbol === 'function' && this instanceof Symbol) {
|
||||
return new Assertion(this.valueOf(), null, shouldGetter);
|
||||
}
|
||||
return new Assertion(this, null, shouldGetter);
|
||||
}
|
||||
function shouldSetter(value) {
|
||||
// See https://github.com/chaijs/chai/issues/86: this makes
|
||||
// `whatever.should = someValue` actually set `someValue`, which is
|
||||
// especially useful for `global.should = require('chai').should()`.
|
||||
//
|
||||
// Note that we have to use [[DefineProperty]] instead of [[Put]]
|
||||
// since otherwise we would trigger this very setter!
|
||||
Object.defineProperty(this, 'should', {
|
||||
value: value,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
// modify Object.prototype to have `should`
|
||||
Object.defineProperty(Object.prototype, 'should', {
|
||||
set: shouldSetter
|
||||
, get: shouldGetter
|
||||
, configurable: true
|
||||
});
|
||||
|
||||
var should = {};
|
||||
|
||||
/**
|
||||
* ### .fail([message])
|
||||
* ### .fail(actual, expected, [message], [operator])
|
||||
*
|
||||
* Throw a failure.
|
||||
*
|
||||
* should.fail();
|
||||
* should.fail("custom error message");
|
||||
* should.fail(1, 2);
|
||||
* should.fail(1, 2, "custom error message");
|
||||
* should.fail(1, 2, "custom error message", ">");
|
||||
* should.fail(1, 2, undefined, ">");
|
||||
*
|
||||
*
|
||||
* @name fail
|
||||
* @param {Mixed} actual
|
||||
* @param {Mixed} expected
|
||||
* @param {String} message
|
||||
* @param {String} operator
|
||||
* @namespace BDD
|
||||
* @api public
|
||||
*/
|
||||
|
||||
should.fail = function (actual, expected, message, operator) {
|
||||
if (arguments.length < 2) {
|
||||
message = actual;
|
||||
actual = undefined;
|
||||
}
|
||||
|
||||
message = message || 'should.fail()';
|
||||
throw new chai.AssertionError(message, {
|
||||
actual: actual
|
||||
, expected: expected
|
||||
, operator: operator
|
||||
}, should.fail);
|
||||
};
|
||||
|
||||
/**
|
||||
* ### .equal(actual, expected, [message])
|
||||
*
|
||||
* Asserts non-strict equality (`==`) of `actual` and `expected`.
|
||||
*
|
||||
* should.equal(3, '3', '== coerces values to strings');
|
||||
*
|
||||
* @name equal
|
||||
* @param {Mixed} actual
|
||||
* @param {Mixed} expected
|
||||
* @param {String} message
|
||||
* @namespace Should
|
||||
* @api public
|
||||
*/
|
||||
|
||||
should.equal = function (val1, val2, msg) {
|
||||
new Assertion(val1, msg).to.equal(val2);
|
||||
};
|
||||
|
||||
/**
|
||||
* ### .throw(function, [constructor/string/regexp], [string/regexp], [message])
|
||||
*
|
||||
* Asserts that `function` will throw an error that is an instance of
|
||||
* `constructor`, or alternately that it will throw an error with message
|
||||
* matching `regexp`.
|
||||
*
|
||||
* should.throw(fn, 'function throws a reference error');
|
||||
* should.throw(fn, /function throws a reference error/);
|
||||
* should.throw(fn, ReferenceError);
|
||||
* should.throw(fn, ReferenceError, 'function throws a reference error');
|
||||
* should.throw(fn, ReferenceError, /function throws a reference error/);
|
||||
*
|
||||
* @name throw
|
||||
* @alias Throw
|
||||
* @param {Function} function
|
||||
* @param {ErrorConstructor} constructor
|
||||
* @param {RegExp} regexp
|
||||
* @param {String} message
|
||||
* @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
|
||||
* @namespace Should
|
||||
* @api public
|
||||
*/
|
||||
|
||||
should.Throw = function (fn, errt, errs, msg) {
|
||||
new Assertion(fn, msg).to.Throw(errt, errs);
|
||||
};
|
||||
|
||||
/**
|
||||
* ### .exist
|
||||
*
|
||||
* Asserts that the target is neither `null` nor `undefined`.
|
||||
*
|
||||
* var foo = 'hi';
|
||||
*
|
||||
* should.exist(foo, 'foo exists');
|
||||
*
|
||||
* @name exist
|
||||
* @namespace Should
|
||||
* @api public
|
||||
*/
|
||||
|
||||
should.exist = function (val, msg) {
|
||||
new Assertion(val, msg).to.exist;
|
||||
}
|
||||
|
||||
// negation
|
||||
should.not = {}
|
||||
|
||||
/**
|
||||
* ### .not.equal(actual, expected, [message])
|
||||
*
|
||||
* Asserts non-strict inequality (`!=`) of `actual` and `expected`.
|
||||
*
|
||||
* should.not.equal(3, 4, 'these numbers are not equal');
|
||||
*
|
||||
* @name not.equal
|
||||
* @param {Mixed} actual
|
||||
* @param {Mixed} expected
|
||||
* @param {String} message
|
||||
* @namespace Should
|
||||
* @api public
|
||||
*/
|
||||
|
||||
should.not.equal = function (val1, val2, msg) {
|
||||
new Assertion(val1, msg).to.not.equal(val2);
|
||||
};
|
||||
|
||||
/**
|
||||
* ### .throw(function, [constructor/regexp], [message])
|
||||
*
|
||||
* Asserts that `function` will _not_ throw an error that is an instance of
|
||||
* `constructor`, or alternately that it will not throw an error with message
|
||||
* matching `regexp`.
|
||||
*
|
||||
* should.not.throw(fn, Error, 'function does not throw');
|
||||
*
|
||||
* @name not.throw
|
||||
* @alias not.Throw
|
||||
* @param {Function} function
|
||||
* @param {ErrorConstructor} constructor
|
||||
* @param {RegExp} regexp
|
||||
* @param {String} message
|
||||
* @see https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/Error#Error_types
|
||||
* @namespace Should
|
||||
* @api public
|
||||
*/
|
||||
|
||||
should.not.Throw = function (fn, errt, errs, msg) {
|
||||
new Assertion(fn, msg).to.not.Throw(errt, errs);
|
||||
};
|
||||
|
||||
/**
|
||||
* ### .not.exist
|
||||
*
|
||||
* Asserts that the target is neither `null` nor `undefined`.
|
||||
*
|
||||
* var bar = null;
|
||||
*
|
||||
* should.not.exist(bar, 'bar does not exist');
|
||||
*
|
||||
* @name not.exist
|
||||
* @namespace Should
|
||||
* @api public
|
||||
*/
|
||||
|
||||
should.not.exist = function (val, msg) {
|
||||
new Assertion(val, msg).to.not.exist;
|
||||
}
|
||||
|
||||
should['throw'] = should['Throw'];
|
||||
should.not['throw'] = should.not['Throw'];
|
||||
|
||||
return should;
|
||||
};
|
||||
|
||||
chai.should = loadShould;
|
||||
chai.Should = loadShould;
|
||||
};
|
152
node_modules/chai/lib/chai/utils/addChainableMethod.js
generated
vendored
Normal file
152
node_modules/chai/lib/chai/utils/addChainableMethod.js
generated
vendored
Normal file
@ -0,0 +1,152 @@
|
||||
/*!
|
||||
* Chai - addChainingMethod utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var addLengthGuard = require('./addLengthGuard');
|
||||
var chai = require('../../chai');
|
||||
var flag = require('./flag');
|
||||
var proxify = require('./proxify');
|
||||
var transferFlags = require('./transferFlags');
|
||||
|
||||
/*!
|
||||
* Module variables
|
||||
*/
|
||||
|
||||
// Check whether `Object.setPrototypeOf` is supported
|
||||
var canSetPrototype = typeof Object.setPrototypeOf === 'function';
|
||||
|
||||
// Without `Object.setPrototypeOf` support, this module will need to add properties to a function.
|
||||
// However, some of functions' own props are not configurable and should be skipped.
|
||||
var testFn = function() {};
|
||||
var excludeNames = Object.getOwnPropertyNames(testFn).filter(function(name) {
|
||||
var propDesc = Object.getOwnPropertyDescriptor(testFn, name);
|
||||
|
||||
// Note: PhantomJS 1.x includes `callee` as one of `testFn`'s own properties,
|
||||
// but then returns `undefined` as the property descriptor for `callee`. As a
|
||||
// workaround, we perform an otherwise unnecessary type-check for `propDesc`,
|
||||
// and then filter it out if it's not an object as it should be.
|
||||
if (typeof propDesc !== 'object')
|
||||
return true;
|
||||
|
||||
return !propDesc.configurable;
|
||||
});
|
||||
|
||||
// Cache `Function` properties
|
||||
var call = Function.prototype.call,
|
||||
apply = Function.prototype.apply;
|
||||
|
||||
/**
|
||||
* ### .addChainableMethod(ctx, name, method, chainingBehavior)
|
||||
*
|
||||
* Adds a method to an object, such that the method can also be chained.
|
||||
*
|
||||
* utils.addChainableMethod(chai.Assertion.prototype, 'foo', function (str) {
|
||||
* var obj = utils.flag(this, 'object');
|
||||
* new chai.Assertion(obj).to.be.equal(str);
|
||||
* });
|
||||
*
|
||||
* Can also be accessed directly from `chai.Assertion`.
|
||||
*
|
||||
* chai.Assertion.addChainableMethod('foo', fn, chainingBehavior);
|
||||
*
|
||||
* The result can then be used as both a method assertion, executing both `method` and
|
||||
* `chainingBehavior`, or as a language chain, which only executes `chainingBehavior`.
|
||||
*
|
||||
* expect(fooStr).to.be.foo('bar');
|
||||
* expect(fooStr).to.be.foo.equal('foo');
|
||||
*
|
||||
* @param {Object} ctx object to which the method is added
|
||||
* @param {String} name of method to add
|
||||
* @param {Function} method function to be used for `name`, when called
|
||||
* @param {Function} chainingBehavior function to be called every time the property is accessed
|
||||
* @namespace Utils
|
||||
* @name addChainableMethod
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function addChainableMethod(ctx, name, method, chainingBehavior) {
|
||||
if (typeof chainingBehavior !== 'function') {
|
||||
chainingBehavior = function () { };
|
||||
}
|
||||
|
||||
var chainableBehavior = {
|
||||
method: method
|
||||
, chainingBehavior: chainingBehavior
|
||||
};
|
||||
|
||||
// save the methods so we can overwrite them later, if we need to.
|
||||
if (!ctx.__methods) {
|
||||
ctx.__methods = {};
|
||||
}
|
||||
ctx.__methods[name] = chainableBehavior;
|
||||
|
||||
Object.defineProperty(ctx, name,
|
||||
{ get: function chainableMethodGetter() {
|
||||
chainableBehavior.chainingBehavior.call(this);
|
||||
|
||||
var chainableMethodWrapper = function () {
|
||||
// Setting the `ssfi` flag to `chainableMethodWrapper` causes this
|
||||
// function to be the starting point for removing implementation
|
||||
// frames from the stack trace of a failed assertion.
|
||||
//
|
||||
// However, we only want to use this function as the starting point if
|
||||
// the `lockSsfi` flag isn't set.
|
||||
//
|
||||
// If the `lockSsfi` flag is set, then this assertion is being
|
||||
// invoked from inside of another assertion. In this case, the `ssfi`
|
||||
// flag has already been set by the outer assertion.
|
||||
//
|
||||
// Note that overwriting a chainable method merely replaces the saved
|
||||
// methods in `ctx.__methods` instead of completely replacing the
|
||||
// overwritten assertion. Therefore, an overwriting assertion won't
|
||||
// set the `ssfi` or `lockSsfi` flags.
|
||||
if (!flag(this, 'lockSsfi')) {
|
||||
flag(this, 'ssfi', chainableMethodWrapper);
|
||||
}
|
||||
|
||||
var result = chainableBehavior.method.apply(this, arguments);
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
|
||||
var newAssertion = new chai.Assertion();
|
||||
transferFlags(this, newAssertion);
|
||||
return newAssertion;
|
||||
};
|
||||
|
||||
addLengthGuard(chainableMethodWrapper, name, true);
|
||||
|
||||
// Use `Object.setPrototypeOf` if available
|
||||
if (canSetPrototype) {
|
||||
// Inherit all properties from the object by replacing the `Function` prototype
|
||||
var prototype = Object.create(this);
|
||||
// Restore the `call` and `apply` methods from `Function`
|
||||
prototype.call = call;
|
||||
prototype.apply = apply;
|
||||
Object.setPrototypeOf(chainableMethodWrapper, prototype);
|
||||
}
|
||||
// Otherwise, redefine all properties (slow!)
|
||||
else {
|
||||
var asserterNames = Object.getOwnPropertyNames(ctx);
|
||||
asserterNames.forEach(function (asserterName) {
|
||||
if (excludeNames.indexOf(asserterName) !== -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
var pd = Object.getOwnPropertyDescriptor(ctx, asserterName);
|
||||
Object.defineProperty(chainableMethodWrapper, asserterName, pd);
|
||||
});
|
||||
}
|
||||
|
||||
transferFlags(this, chainableMethodWrapper);
|
||||
return proxify(chainableMethodWrapper);
|
||||
}
|
||||
, configurable: true
|
||||
});
|
||||
};
|
60
node_modules/chai/lib/chai/utils/addLengthGuard.js
generated
vendored
Normal file
60
node_modules/chai/lib/chai/utils/addLengthGuard.js
generated
vendored
Normal file
@ -0,0 +1,60 @@
|
||||
var fnLengthDesc = Object.getOwnPropertyDescriptor(function () {}, 'length');
|
||||
|
||||
/*!
|
||||
* Chai - addLengthGuard utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* ### .addLengthGuard(fn, assertionName, isChainable)
|
||||
*
|
||||
* Define `length` as a getter on the given uninvoked method assertion. The
|
||||
* getter acts as a guard against chaining `length` directly off of an uninvoked
|
||||
* method assertion, which is a problem because it references `function`'s
|
||||
* built-in `length` property instead of Chai's `length` assertion. When the
|
||||
* getter catches the user making this mistake, it throws an error with a
|
||||
* helpful message.
|
||||
*
|
||||
* There are two ways in which this mistake can be made. The first way is by
|
||||
* chaining the `length` assertion directly off of an uninvoked chainable
|
||||
* method. In this case, Chai suggests that the user use `lengthOf` instead. The
|
||||
* second way is by chaining the `length` assertion directly off of an uninvoked
|
||||
* non-chainable method. Non-chainable methods must be invoked prior to
|
||||
* chaining. In this case, Chai suggests that the user consult the docs for the
|
||||
* given assertion.
|
||||
*
|
||||
* If the `length` property of functions is unconfigurable, then return `fn`
|
||||
* without modification.
|
||||
*
|
||||
* Note that in ES6, the function's `length` property is configurable, so once
|
||||
* support for legacy environments is dropped, Chai's `length` property can
|
||||
* replace the built-in function's `length` property, and this length guard will
|
||||
* no longer be necessary. In the mean time, maintaining consistency across all
|
||||
* environments is the priority.
|
||||
*
|
||||
* @param {Function} fn
|
||||
* @param {String} assertionName
|
||||
* @param {Boolean} isChainable
|
||||
* @namespace Utils
|
||||
* @name addLengthGuard
|
||||
*/
|
||||
|
||||
module.exports = function addLengthGuard (fn, assertionName, isChainable) {
|
||||
if (!fnLengthDesc.configurable) return fn;
|
||||
|
||||
Object.defineProperty(fn, 'length', {
|
||||
get: function () {
|
||||
if (isChainable) {
|
||||
throw Error('Invalid Chai property: ' + assertionName + '.length. Due' +
|
||||
' to a compatibility issue, "length" cannot directly follow "' +
|
||||
assertionName + '". Use "' + assertionName + '.lengthOf" instead.');
|
||||
}
|
||||
|
||||
throw Error('Invalid Chai property: ' + assertionName + '.length. See' +
|
||||
' docs for proper usage of "' + assertionName + '".');
|
||||
}
|
||||
});
|
||||
|
||||
return fn;
|
||||
};
|
68
node_modules/chai/lib/chai/utils/addMethod.js
generated
vendored
Normal file
68
node_modules/chai/lib/chai/utils/addMethod.js
generated
vendored
Normal file
@ -0,0 +1,68 @@
|
||||
/*!
|
||||
* Chai - addMethod utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
var addLengthGuard = require('./addLengthGuard');
|
||||
var chai = require('../../chai');
|
||||
var flag = require('./flag');
|
||||
var proxify = require('./proxify');
|
||||
var transferFlags = require('./transferFlags');
|
||||
|
||||
/**
|
||||
* ### .addMethod(ctx, name, method)
|
||||
*
|
||||
* Adds a method to the prototype of an object.
|
||||
*
|
||||
* utils.addMethod(chai.Assertion.prototype, 'foo', function (str) {
|
||||
* var obj = utils.flag(this, 'object');
|
||||
* new chai.Assertion(obj).to.be.equal(str);
|
||||
* });
|
||||
*
|
||||
* Can also be accessed directly from `chai.Assertion`.
|
||||
*
|
||||
* chai.Assertion.addMethod('foo', fn);
|
||||
*
|
||||
* Then can be used as any other assertion.
|
||||
*
|
||||
* expect(fooStr).to.be.foo('bar');
|
||||
*
|
||||
* @param {Object} ctx object to which the method is added
|
||||
* @param {String} name of method to add
|
||||
* @param {Function} method function to be used for name
|
||||
* @namespace Utils
|
||||
* @name addMethod
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function addMethod(ctx, name, method) {
|
||||
var methodWrapper = function () {
|
||||
// Setting the `ssfi` flag to `methodWrapper` causes this function to be the
|
||||
// starting point for removing implementation frames from the stack trace of
|
||||
// a failed assertion.
|
||||
//
|
||||
// However, we only want to use this function as the starting point if the
|
||||
// `lockSsfi` flag isn't set.
|
||||
//
|
||||
// If the `lockSsfi` flag is set, then either this assertion has been
|
||||
// overwritten by another assertion, or this assertion is being invoked from
|
||||
// inside of another assertion. In the first case, the `ssfi` flag has
|
||||
// already been set by the overwriting assertion. In the second case, the
|
||||
// `ssfi` flag has already been set by the outer assertion.
|
||||
if (!flag(this, 'lockSsfi')) {
|
||||
flag(this, 'ssfi', methodWrapper);
|
||||
}
|
||||
|
||||
var result = method.apply(this, arguments);
|
||||
if (result !== undefined)
|
||||
return result;
|
||||
|
||||
var newAssertion = new chai.Assertion();
|
||||
transferFlags(this, newAssertion);
|
||||
return newAssertion;
|
||||
};
|
||||
|
||||
addLengthGuard(methodWrapper, name, false);
|
||||
ctx[name] = proxify(methodWrapper, name);
|
||||
};
|
72
node_modules/chai/lib/chai/utils/addProperty.js
generated
vendored
Normal file
72
node_modules/chai/lib/chai/utils/addProperty.js
generated
vendored
Normal file
@ -0,0 +1,72 @@
|
||||
/*!
|
||||
* Chai - addProperty utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
var chai = require('../../chai');
|
||||
var flag = require('./flag');
|
||||
var isProxyEnabled = require('./isProxyEnabled');
|
||||
var transferFlags = require('./transferFlags');
|
||||
|
||||
/**
|
||||
* ### .addProperty(ctx, name, getter)
|
||||
*
|
||||
* Adds a property to the prototype of an object.
|
||||
*
|
||||
* utils.addProperty(chai.Assertion.prototype, 'foo', function () {
|
||||
* var obj = utils.flag(this, 'object');
|
||||
* new chai.Assertion(obj).to.be.instanceof(Foo);
|
||||
* });
|
||||
*
|
||||
* Can also be accessed directly from `chai.Assertion`.
|
||||
*
|
||||
* chai.Assertion.addProperty('foo', fn);
|
||||
*
|
||||
* Then can be used as any other assertion.
|
||||
*
|
||||
* expect(myFoo).to.be.foo;
|
||||
*
|
||||
* @param {Object} ctx object to which the property is added
|
||||
* @param {String} name of property to add
|
||||
* @param {Function} getter function to be used for name
|
||||
* @namespace Utils
|
||||
* @name addProperty
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function addProperty(ctx, name, getter) {
|
||||
getter = getter === undefined ? function () {} : getter;
|
||||
|
||||
Object.defineProperty(ctx, name,
|
||||
{ get: function propertyGetter() {
|
||||
// Setting the `ssfi` flag to `propertyGetter` causes this function to
|
||||
// be the starting point for removing implementation frames from the
|
||||
// stack trace of a failed assertion.
|
||||
//
|
||||
// However, we only want to use this function as the starting point if
|
||||
// the `lockSsfi` flag isn't set and proxy protection is disabled.
|
||||
//
|
||||
// If the `lockSsfi` flag is set, then either this assertion has been
|
||||
// overwritten by another assertion, or this assertion is being invoked
|
||||
// from inside of another assertion. In the first case, the `ssfi` flag
|
||||
// has already been set by the overwriting assertion. In the second
|
||||
// case, the `ssfi` flag has already been set by the outer assertion.
|
||||
//
|
||||
// If proxy protection is enabled, then the `ssfi` flag has already been
|
||||
// set by the proxy getter.
|
||||
if (!isProxyEnabled() && !flag(this, 'lockSsfi')) {
|
||||
flag(this, 'ssfi', propertyGetter);
|
||||
}
|
||||
|
||||
var result = getter.call(this);
|
||||
if (result !== undefined)
|
||||
return result;
|
||||
|
||||
var newAssertion = new chai.Assertion();
|
||||
transferFlags(this, newAssertion);
|
||||
return newAssertion;
|
||||
}
|
||||
, configurable: true
|
||||
});
|
||||
};
|
31
node_modules/chai/lib/chai/utils/compareByInspect.js
generated
vendored
Normal file
31
node_modules/chai/lib/chai/utils/compareByInspect.js
generated
vendored
Normal file
@ -0,0 +1,31 @@
|
||||
/*!
|
||||
* Chai - compareByInspect utility
|
||||
* Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var inspect = require('./inspect');
|
||||
|
||||
/**
|
||||
* ### .compareByInspect(mixed, mixed)
|
||||
*
|
||||
* To be used as a compareFunction with Array.prototype.sort. Compares elements
|
||||
* using inspect instead of default behavior of using toString so that Symbols
|
||||
* and objects with irregular/missing toString can still be sorted without a
|
||||
* TypeError.
|
||||
*
|
||||
* @param {Mixed} first element to compare
|
||||
* @param {Mixed} second element to compare
|
||||
* @returns {Number} -1 if 'a' should come before 'b'; otherwise 1
|
||||
* @name compareByInspect
|
||||
* @namespace Utils
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function compareByInspect(a, b) {
|
||||
return inspect(a) < inspect(b) ? -1 : 1;
|
||||
};
|
51
node_modules/chai/lib/chai/utils/expectTypes.js
generated
vendored
Normal file
51
node_modules/chai/lib/chai/utils/expectTypes.js
generated
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
/*!
|
||||
* Chai - expectTypes utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* ### .expectTypes(obj, types)
|
||||
*
|
||||
* Ensures that the object being tested against is of a valid type.
|
||||
*
|
||||
* utils.expectTypes(this, ['array', 'object', 'string']);
|
||||
*
|
||||
* @param {Mixed} obj constructed Assertion
|
||||
* @param {Array} type A list of allowed types for this assertion
|
||||
* @namespace Utils
|
||||
* @name expectTypes
|
||||
* @api public
|
||||
*/
|
||||
|
||||
var AssertionError = require('assertion-error');
|
||||
var flag = require('./flag');
|
||||
var type = require('type-detect');
|
||||
|
||||
module.exports = function expectTypes(obj, types) {
|
||||
var flagMsg = flag(obj, 'message');
|
||||
var ssfi = flag(obj, 'ssfi');
|
||||
|
||||
flagMsg = flagMsg ? flagMsg + ': ' : '';
|
||||
|
||||
obj = flag(obj, 'object');
|
||||
types = types.map(function (t) { return t.toLowerCase(); });
|
||||
types.sort();
|
||||
|
||||
// Transforms ['lorem', 'ipsum'] into 'a lorem, or an ipsum'
|
||||
var str = types.map(function (t, index) {
|
||||
var art = ~[ 'a', 'e', 'i', 'o', 'u' ].indexOf(t.charAt(0)) ? 'an' : 'a';
|
||||
var or = types.length > 1 && index === types.length - 1 ? 'or ' : '';
|
||||
return or + art + ' ' + t;
|
||||
}).join(', ');
|
||||
|
||||
var objType = type(obj).toLowerCase();
|
||||
|
||||
if (!types.some(function (expected) { return objType === expected; })) {
|
||||
throw new AssertionError(
|
||||
flagMsg + 'object tested must be ' + str + ', but ' + objType + ' given',
|
||||
undefined,
|
||||
ssfi
|
||||
);
|
||||
}
|
||||
};
|
33
node_modules/chai/lib/chai/utils/flag.js
generated
vendored
Normal file
33
node_modules/chai/lib/chai/utils/flag.js
generated
vendored
Normal file
@ -0,0 +1,33 @@
|
||||
/*!
|
||||
* Chai - flag utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* ### .flag(object, key, [value])
|
||||
*
|
||||
* Get or set a flag value on an object. If a
|
||||
* value is provided it will be set, else it will
|
||||
* return the currently set value or `undefined` if
|
||||
* the value is not set.
|
||||
*
|
||||
* utils.flag(this, 'foo', 'bar'); // setter
|
||||
* utils.flag(this, 'foo'); // getter, returns `bar`
|
||||
*
|
||||
* @param {Object} object constructed Assertion
|
||||
* @param {String} key
|
||||
* @param {Mixed} value (optional)
|
||||
* @namespace Utils
|
||||
* @name flag
|
||||
* @api private
|
||||
*/
|
||||
|
||||
module.exports = function flag(obj, key, value) {
|
||||
var flags = obj.__flags || (obj.__flags = Object.create(null));
|
||||
if (arguments.length === 3) {
|
||||
flags[key] = value;
|
||||
} else {
|
||||
return flags[key];
|
||||
}
|
||||
};
|
20
node_modules/chai/lib/chai/utils/getActual.js
generated
vendored
Normal file
20
node_modules/chai/lib/chai/utils/getActual.js
generated
vendored
Normal file
@ -0,0 +1,20 @@
|
||||
/*!
|
||||
* Chai - getActual utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* ### .getActual(object, [actual])
|
||||
*
|
||||
* Returns the `actual` value for an Assertion.
|
||||
*
|
||||
* @param {Object} object (constructed Assertion)
|
||||
* @param {Arguments} chai.Assertion.prototype.assert arguments
|
||||
* @namespace Utils
|
||||
* @name getActual
|
||||
*/
|
||||
|
||||
module.exports = function getActual(obj, args) {
|
||||
return args.length > 4 ? args[4] : obj._obj;
|
||||
};
|
26
node_modules/chai/lib/chai/utils/getEnumerableProperties.js
generated
vendored
Normal file
26
node_modules/chai/lib/chai/utils/getEnumerableProperties.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/*!
|
||||
* Chai - getEnumerableProperties utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* ### .getEnumerableProperties(object)
|
||||
*
|
||||
* This allows the retrieval of enumerable property names of an object,
|
||||
* inherited or not.
|
||||
*
|
||||
* @param {Object} object
|
||||
* @returns {Array}
|
||||
* @namespace Utils
|
||||
* @name getEnumerableProperties
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function getEnumerableProperties(object) {
|
||||
var result = [];
|
||||
for (var name in object) {
|
||||
result.push(name);
|
||||
}
|
||||
return result;
|
||||
};
|
50
node_modules/chai/lib/chai/utils/getMessage.js
generated
vendored
Normal file
50
node_modules/chai/lib/chai/utils/getMessage.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
/*!
|
||||
* Chai - message composition utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var flag = require('./flag')
|
||||
, getActual = require('./getActual')
|
||||
, objDisplay = require('./objDisplay');
|
||||
|
||||
/**
|
||||
* ### .getMessage(object, message, negateMessage)
|
||||
*
|
||||
* Construct the error message based on flags
|
||||
* and template tags. Template tags will return
|
||||
* a stringified inspection of the object referenced.
|
||||
*
|
||||
* Message template tags:
|
||||
* - `#{this}` current asserted object
|
||||
* - `#{act}` actual value
|
||||
* - `#{exp}` expected value
|
||||
*
|
||||
* @param {Object} object (constructed Assertion)
|
||||
* @param {Arguments} chai.Assertion.prototype.assert arguments
|
||||
* @namespace Utils
|
||||
* @name getMessage
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function getMessage(obj, args) {
|
||||
var negate = flag(obj, 'negate')
|
||||
, val = flag(obj, 'object')
|
||||
, expected = args[3]
|
||||
, actual = getActual(obj, args)
|
||||
, msg = negate ? args[2] : args[1]
|
||||
, flagMsg = flag(obj, 'message');
|
||||
|
||||
if(typeof msg === "function") msg = msg();
|
||||
msg = msg || '';
|
||||
msg = msg
|
||||
.replace(/#\{this\}/g, function () { return objDisplay(val); })
|
||||
.replace(/#\{act\}/g, function () { return objDisplay(actual); })
|
||||
.replace(/#\{exp\}/g, function () { return objDisplay(expected); });
|
||||
|
||||
return flagMsg ? flagMsg + ': ' + msg : msg;
|
||||
};
|
29
node_modules/chai/lib/chai/utils/getOwnEnumerableProperties.js
generated
vendored
Normal file
29
node_modules/chai/lib/chai/utils/getOwnEnumerableProperties.js
generated
vendored
Normal file
@ -0,0 +1,29 @@
|
||||
/*!
|
||||
* Chai - getOwnEnumerableProperties utility
|
||||
* Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var getOwnEnumerablePropertySymbols = require('./getOwnEnumerablePropertySymbols');
|
||||
|
||||
/**
|
||||
* ### .getOwnEnumerableProperties(object)
|
||||
*
|
||||
* This allows the retrieval of directly-owned enumerable property names and
|
||||
* symbols of an object. This function is necessary because Object.keys only
|
||||
* returns enumerable property names, not enumerable property symbols.
|
||||
*
|
||||
* @param {Object} object
|
||||
* @returns {Array}
|
||||
* @namespace Utils
|
||||
* @name getOwnEnumerableProperties
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function getOwnEnumerableProperties(obj) {
|
||||
return Object.keys(obj).concat(getOwnEnumerablePropertySymbols(obj));
|
||||
};
|
27
node_modules/chai/lib/chai/utils/getOwnEnumerablePropertySymbols.js
generated
vendored
Normal file
27
node_modules/chai/lib/chai/utils/getOwnEnumerablePropertySymbols.js
generated
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
/*!
|
||||
* Chai - getOwnEnumerablePropertySymbols utility
|
||||
* Copyright(c) 2011-2016 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* ### .getOwnEnumerablePropertySymbols(object)
|
||||
*
|
||||
* This allows the retrieval of directly-owned enumerable property symbols of an
|
||||
* object. This function is necessary because Object.getOwnPropertySymbols
|
||||
* returns both enumerable and non-enumerable property symbols.
|
||||
*
|
||||
* @param {Object} object
|
||||
* @returns {Array}
|
||||
* @namespace Utils
|
||||
* @name getOwnEnumerablePropertySymbols
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function getOwnEnumerablePropertySymbols(obj) {
|
||||
if (typeof Object.getOwnPropertySymbols !== 'function') return [];
|
||||
|
||||
return Object.getOwnPropertySymbols(obj).filter(function (sym) {
|
||||
return Object.getOwnPropertyDescriptor(obj, sym).enumerable;
|
||||
});
|
||||
};
|
36
node_modules/chai/lib/chai/utils/getProperties.js
generated
vendored
Normal file
36
node_modules/chai/lib/chai/utils/getProperties.js
generated
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
/*!
|
||||
* Chai - getProperties utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* ### .getProperties(object)
|
||||
*
|
||||
* This allows the retrieval of property names of an object, enumerable or not,
|
||||
* inherited or not.
|
||||
*
|
||||
* @param {Object} object
|
||||
* @returns {Array}
|
||||
* @namespace Utils
|
||||
* @name getProperties
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function getProperties(object) {
|
||||
var result = Object.getOwnPropertyNames(object);
|
||||
|
||||
function addProperty(property) {
|
||||
if (result.indexOf(property) === -1) {
|
||||
result.push(property);
|
||||
}
|
||||
}
|
||||
|
||||
var proto = Object.getPrototypeOf(object);
|
||||
while (proto !== null) {
|
||||
Object.getOwnPropertyNames(proto).forEach(addProperty);
|
||||
proto = Object.getPrototypeOf(proto);
|
||||
}
|
||||
|
||||
return result;
|
||||
};
|
172
node_modules/chai/lib/chai/utils/index.js
generated
vendored
Normal file
172
node_modules/chai/lib/chai/utils/index.js
generated
vendored
Normal file
@ -0,0 +1,172 @@
|
||||
/*!
|
||||
* chai
|
||||
* Copyright(c) 2011 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Dependencies that are used for multiple exports are required here only once
|
||||
*/
|
||||
|
||||
var pathval = require('pathval');
|
||||
|
||||
/*!
|
||||
* test utility
|
||||
*/
|
||||
|
||||
exports.test = require('./test');
|
||||
|
||||
/*!
|
||||
* type utility
|
||||
*/
|
||||
|
||||
exports.type = require('type-detect');
|
||||
|
||||
/*!
|
||||
* expectTypes utility
|
||||
*/
|
||||
exports.expectTypes = require('./expectTypes');
|
||||
|
||||
/*!
|
||||
* message utility
|
||||
*/
|
||||
|
||||
exports.getMessage = require('./getMessage');
|
||||
|
||||
/*!
|
||||
* actual utility
|
||||
*/
|
||||
|
||||
exports.getActual = require('./getActual');
|
||||
|
||||
/*!
|
||||
* Inspect util
|
||||
*/
|
||||
|
||||
exports.inspect = require('./inspect');
|
||||
|
||||
/*!
|
||||
* Object Display util
|
||||
*/
|
||||
|
||||
exports.objDisplay = require('./objDisplay');
|
||||
|
||||
/*!
|
||||
* Flag utility
|
||||
*/
|
||||
|
||||
exports.flag = require('./flag');
|
||||
|
||||
/*!
|
||||
* Flag transferring utility
|
||||
*/
|
||||
|
||||
exports.transferFlags = require('./transferFlags');
|
||||
|
||||
/*!
|
||||
* Deep equal utility
|
||||
*/
|
||||
|
||||
exports.eql = require('deep-eql');
|
||||
|
||||
/*!
|
||||
* Deep path info
|
||||
*/
|
||||
|
||||
exports.getPathInfo = pathval.getPathInfo;
|
||||
|
||||
/*!
|
||||
* Check if a property exists
|
||||
*/
|
||||
|
||||
exports.hasProperty = pathval.hasProperty;
|
||||
|
||||
/*!
|
||||
* Function name
|
||||
*/
|
||||
|
||||
exports.getName = require('get-func-name');
|
||||
|
||||
/*!
|
||||
* add Property
|
||||
*/
|
||||
|
||||
exports.addProperty = require('./addProperty');
|
||||
|
||||
/*!
|
||||
* add Method
|
||||
*/
|
||||
|
||||
exports.addMethod = require('./addMethod');
|
||||
|
||||
/*!
|
||||
* overwrite Property
|
||||
*/
|
||||
|
||||
exports.overwriteProperty = require('./overwriteProperty');
|
||||
|
||||
/*!
|
||||
* overwrite Method
|
||||
*/
|
||||
|
||||
exports.overwriteMethod = require('./overwriteMethod');
|
||||
|
||||
/*!
|
||||
* Add a chainable method
|
||||
*/
|
||||
|
||||
exports.addChainableMethod = require('./addChainableMethod');
|
||||
|
||||
/*!
|
||||
* Overwrite chainable method
|
||||
*/
|
||||
|
||||
exports.overwriteChainableMethod = require('./overwriteChainableMethod');
|
||||
|
||||
/*!
|
||||
* Compare by inspect method
|
||||
*/
|
||||
|
||||
exports.compareByInspect = require('./compareByInspect');
|
||||
|
||||
/*!
|
||||
* Get own enumerable property symbols method
|
||||
*/
|
||||
|
||||
exports.getOwnEnumerablePropertySymbols = require('./getOwnEnumerablePropertySymbols');
|
||||
|
||||
/*!
|
||||
* Get own enumerable properties method
|
||||
*/
|
||||
|
||||
exports.getOwnEnumerableProperties = require('./getOwnEnumerableProperties');
|
||||
|
||||
/*!
|
||||
* Checks error against a given set of criteria
|
||||
*/
|
||||
|
||||
exports.checkError = require('check-error');
|
||||
|
||||
/*!
|
||||
* Proxify util
|
||||
*/
|
||||
|
||||
exports.proxify = require('./proxify');
|
||||
|
||||
/*!
|
||||
* addLengthGuard util
|
||||
*/
|
||||
|
||||
exports.addLengthGuard = require('./addLengthGuard');
|
||||
|
||||
/*!
|
||||
* isProxyEnabled helper
|
||||
*/
|
||||
|
||||
exports.isProxyEnabled = require('./isProxyEnabled');
|
||||
|
||||
/*!
|
||||
* isNaN method
|
||||
*/
|
||||
|
||||
exports.isNaN = require('./isNaN');
|
376
node_modules/chai/lib/chai/utils/inspect.js
generated
vendored
Normal file
376
node_modules/chai/lib/chai/utils/inspect.js
generated
vendored
Normal file
@ -0,0 +1,376 @@
|
||||
// This is (almost) directly from Node.js utils
|
||||
// https://github.com/joyent/node/blob/f8c335d0caf47f16d31413f89aa28eda3878e3aa/lib/util.js
|
||||
|
||||
var getName = require('get-func-name');
|
||||
var getProperties = require('./getProperties');
|
||||
var getEnumerableProperties = require('./getEnumerableProperties');
|
||||
var config = require('../config');
|
||||
|
||||
module.exports = inspect;
|
||||
|
||||
/**
|
||||
* ### .inspect(obj, [showHidden], [depth], [colors])
|
||||
*
|
||||
* Echoes the value of a value. Tries to print the value out
|
||||
* in the best way possible given the different types.
|
||||
*
|
||||
* @param {Object} obj The object to print out.
|
||||
* @param {Boolean} showHidden Flag that shows hidden (not enumerable)
|
||||
* properties of objects. Default is false.
|
||||
* @param {Number} depth Depth in which to descend in object. Default is 2.
|
||||
* @param {Boolean} colors Flag to turn on ANSI escape codes to color the
|
||||
* output. Default is false (no coloring).
|
||||
* @namespace Utils
|
||||
* @name inspect
|
||||
*/
|
||||
function inspect(obj, showHidden, depth, colors) {
|
||||
var ctx = {
|
||||
showHidden: showHidden,
|
||||
seen: [],
|
||||
stylize: function (str) { return str; }
|
||||
};
|
||||
return formatValue(ctx, obj, (typeof depth === 'undefined' ? 2 : depth));
|
||||
}
|
||||
|
||||
// Returns true if object is a DOM element.
|
||||
var isDOMElement = function (object) {
|
||||
if (typeof HTMLElement === 'object') {
|
||||
return object instanceof HTMLElement;
|
||||
} else {
|
||||
return object &&
|
||||
typeof object === 'object' &&
|
||||
'nodeType' in object &&
|
||||
object.nodeType === 1 &&
|
||||
typeof object.nodeName === 'string';
|
||||
}
|
||||
};
|
||||
|
||||
function formatValue(ctx, value, recurseTimes) {
|
||||
// Provide a hook for user-specified inspect functions.
|
||||
// Check that value is an object with an inspect function on it
|
||||
if (value && typeof value.inspect === 'function' &&
|
||||
// Filter out the util module, it's inspect function is special
|
||||
value.inspect !== exports.inspect &&
|
||||
// Also filter out any prototype objects using the circular check.
|
||||
!(value.constructor && value.constructor.prototype === value)) {
|
||||
var ret = value.inspect(recurseTimes, ctx);
|
||||
if (typeof ret !== 'string') {
|
||||
ret = formatValue(ctx, ret, recurseTimes);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
// Primitive types cannot have properties
|
||||
var primitive = formatPrimitive(ctx, value);
|
||||
if (primitive) {
|
||||
return primitive;
|
||||
}
|
||||
|
||||
// If this is a DOM element, try to get the outer HTML.
|
||||
if (isDOMElement(value)) {
|
||||
if ('outerHTML' in value) {
|
||||
return value.outerHTML;
|
||||
// This value does not have an outerHTML attribute,
|
||||
// it could still be an XML element
|
||||
} else {
|
||||
// Attempt to serialize it
|
||||
try {
|
||||
if (document.xmlVersion) {
|
||||
var xmlSerializer = new XMLSerializer();
|
||||
return xmlSerializer.serializeToString(value);
|
||||
} else {
|
||||
// Firefox 11- do not support outerHTML
|
||||
// It does, however, support innerHTML
|
||||
// Use the following to render the element
|
||||
var ns = "http://www.w3.org/1999/xhtml";
|
||||
var container = document.createElementNS(ns, '_');
|
||||
|
||||
container.appendChild(value.cloneNode(false));
|
||||
var html = container.innerHTML
|
||||
.replace('><', '>' + value.innerHTML + '<');
|
||||
container.innerHTML = '';
|
||||
return html;
|
||||
}
|
||||
} catch (err) {
|
||||
// This could be a non-native DOM implementation,
|
||||
// continue with the normal flow:
|
||||
// printing the element as if it is an object.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Look up the keys of the object.
|
||||
var visibleKeys = getEnumerableProperties(value);
|
||||
var keys = ctx.showHidden ? getProperties(value) : visibleKeys;
|
||||
|
||||
var name, nameSuffix;
|
||||
|
||||
// Some type of object without properties can be shortcut.
|
||||
// In IE, errors have a single `stack` property, or if they are vanilla `Error`,
|
||||
// a `stack` plus `description` property; ignore those for consistency.
|
||||
if (keys.length === 0 || (isError(value) && (
|
||||
(keys.length === 1 && keys[0] === 'stack') ||
|
||||
(keys.length === 2 && keys[0] === 'description' && keys[1] === 'stack')
|
||||
))) {
|
||||
if (typeof value === 'function') {
|
||||
name = getName(value);
|
||||
nameSuffix = name ? ': ' + name : '';
|
||||
return ctx.stylize('[Function' + nameSuffix + ']', 'special');
|
||||
}
|
||||
if (isRegExp(value)) {
|
||||
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
|
||||
}
|
||||
if (isDate(value)) {
|
||||
return ctx.stylize(Date.prototype.toUTCString.call(value), 'date');
|
||||
}
|
||||
if (isError(value)) {
|
||||
return formatError(value);
|
||||
}
|
||||
}
|
||||
|
||||
var base = ''
|
||||
, array = false
|
||||
, typedArray = false
|
||||
, braces = ['{', '}'];
|
||||
|
||||
if (isTypedArray(value)) {
|
||||
typedArray = true;
|
||||
braces = ['[', ']'];
|
||||
}
|
||||
|
||||
// Make Array say that they are Array
|
||||
if (isArray(value)) {
|
||||
array = true;
|
||||
braces = ['[', ']'];
|
||||
}
|
||||
|
||||
// Make functions say that they are functions
|
||||
if (typeof value === 'function') {
|
||||
name = getName(value);
|
||||
nameSuffix = name ? ': ' + name : '';
|
||||
base = ' [Function' + nameSuffix + ']';
|
||||
}
|
||||
|
||||
// Make RegExps say that they are RegExps
|
||||
if (isRegExp(value)) {
|
||||
base = ' ' + RegExp.prototype.toString.call(value);
|
||||
}
|
||||
|
||||
// Make dates with properties first say the date
|
||||
if (isDate(value)) {
|
||||
base = ' ' + Date.prototype.toUTCString.call(value);
|
||||
}
|
||||
|
||||
// Make error with message first say the error
|
||||
if (isError(value)) {
|
||||
return formatError(value);
|
||||
}
|
||||
|
||||
if (keys.length === 0 && (!array || value.length == 0)) {
|
||||
return braces[0] + base + braces[1];
|
||||
}
|
||||
|
||||
if (recurseTimes < 0) {
|
||||
if (isRegExp(value)) {
|
||||
return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
|
||||
} else {
|
||||
return ctx.stylize('[Object]', 'special');
|
||||
}
|
||||
}
|
||||
|
||||
ctx.seen.push(value);
|
||||
|
||||
var output;
|
||||
if (array) {
|
||||
output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
|
||||
} else if (typedArray) {
|
||||
return formatTypedArray(value);
|
||||
} else {
|
||||
output = keys.map(function(key) {
|
||||
return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
|
||||
});
|
||||
}
|
||||
|
||||
ctx.seen.pop();
|
||||
|
||||
return reduceToSingleString(output, base, braces);
|
||||
}
|
||||
|
||||
function formatPrimitive(ctx, value) {
|
||||
switch (typeof value) {
|
||||
case 'undefined':
|
||||
return ctx.stylize('undefined', 'undefined');
|
||||
|
||||
case 'string':
|
||||
var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
|
||||
.replace(/'/g, "\\'")
|
||||
.replace(/\\"/g, '"') + '\'';
|
||||
return ctx.stylize(simple, 'string');
|
||||
|
||||
case 'number':
|
||||
if (value === 0 && (1/value) === -Infinity) {
|
||||
return ctx.stylize('-0', 'number');
|
||||
}
|
||||
return ctx.stylize('' + value, 'number');
|
||||
|
||||
case 'boolean':
|
||||
return ctx.stylize('' + value, 'boolean');
|
||||
|
||||
case 'symbol':
|
||||
return ctx.stylize(value.toString(), 'symbol');
|
||||
}
|
||||
// For some reason typeof null is "object", so special case here.
|
||||
if (value === null) {
|
||||
return ctx.stylize('null', 'null');
|
||||
}
|
||||
}
|
||||
|
||||
function formatError(value) {
|
||||
return '[' + Error.prototype.toString.call(value) + ']';
|
||||
}
|
||||
|
||||
function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
|
||||
var output = [];
|
||||
for (var i = 0, l = value.length; i < l; ++i) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, String(i))) {
|
||||
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
|
||||
String(i), true));
|
||||
} else {
|
||||
output.push('');
|
||||
}
|
||||
}
|
||||
|
||||
keys.forEach(function(key) {
|
||||
if (!key.match(/^\d+$/)) {
|
||||
output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
|
||||
key, true));
|
||||
}
|
||||
});
|
||||
return output;
|
||||
}
|
||||
|
||||
function formatTypedArray(value) {
|
||||
var str = '[ ';
|
||||
|
||||
for (var i = 0; i < value.length; ++i) {
|
||||
if (str.length >= config.truncateThreshold - 7) {
|
||||
str += '...';
|
||||
break;
|
||||
}
|
||||
str += value[i] + ', ';
|
||||
}
|
||||
str += ' ]';
|
||||
|
||||
// Removing trailing `, ` if the array was not truncated
|
||||
if (str.indexOf(', ]') !== -1) {
|
||||
str = str.replace(', ]', ' ]');
|
||||
}
|
||||
|
||||
return str;
|
||||
}
|
||||
|
||||
function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
|
||||
var name;
|
||||
var propDescriptor = Object.getOwnPropertyDescriptor(value, key);
|
||||
var str;
|
||||
|
||||
if (propDescriptor) {
|
||||
if (propDescriptor.get) {
|
||||
if (propDescriptor.set) {
|
||||
str = ctx.stylize('[Getter/Setter]', 'special');
|
||||
} else {
|
||||
str = ctx.stylize('[Getter]', 'special');
|
||||
}
|
||||
} else {
|
||||
if (propDescriptor.set) {
|
||||
str = ctx.stylize('[Setter]', 'special');
|
||||
}
|
||||
}
|
||||
}
|
||||
if (visibleKeys.indexOf(key) < 0) {
|
||||
name = '[' + key + ']';
|
||||
}
|
||||
if (!str) {
|
||||
if (ctx.seen.indexOf(value[key]) < 0) {
|
||||
if (recurseTimes === null) {
|
||||
str = formatValue(ctx, value[key], null);
|
||||
} else {
|
||||
str = formatValue(ctx, value[key], recurseTimes - 1);
|
||||
}
|
||||
if (str.indexOf('\n') > -1) {
|
||||
if (array) {
|
||||
str = str.split('\n').map(function(line) {
|
||||
return ' ' + line;
|
||||
}).join('\n').substr(2);
|
||||
} else {
|
||||
str = '\n' + str.split('\n').map(function(line) {
|
||||
return ' ' + line;
|
||||
}).join('\n');
|
||||
}
|
||||
}
|
||||
} else {
|
||||
str = ctx.stylize('[Circular]', 'special');
|
||||
}
|
||||
}
|
||||
if (typeof name === 'undefined') {
|
||||
if (array && key.match(/^\d+$/)) {
|
||||
return str;
|
||||
}
|
||||
name = JSON.stringify('' + key);
|
||||
if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
|
||||
name = name.substr(1, name.length - 2);
|
||||
name = ctx.stylize(name, 'name');
|
||||
} else {
|
||||
name = name.replace(/'/g, "\\'")
|
||||
.replace(/\\"/g, '"')
|
||||
.replace(/(^"|"$)/g, "'");
|
||||
name = ctx.stylize(name, 'string');
|
||||
}
|
||||
}
|
||||
|
||||
return name + ': ' + str;
|
||||
}
|
||||
|
||||
function reduceToSingleString(output, base, braces) {
|
||||
var length = output.reduce(function(prev, cur) {
|
||||
return prev + cur.length + 1;
|
||||
}, 0);
|
||||
|
||||
if (length > 60) {
|
||||
return braces[0] +
|
||||
(base === '' ? '' : base + '\n ') +
|
||||
' ' +
|
||||
output.join(',\n ') +
|
||||
' ' +
|
||||
braces[1];
|
||||
}
|
||||
|
||||
return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
|
||||
}
|
||||
|
||||
function isTypedArray(ar) {
|
||||
// Unfortunately there's no way to check if an object is a TypedArray
|
||||
// We have to check if it's one of these types
|
||||
return (typeof ar === 'object' && /\w+Array]$/.test(objectToString(ar)));
|
||||
}
|
||||
|
||||
function isArray(ar) {
|
||||
return Array.isArray(ar) ||
|
||||
(typeof ar === 'object' && objectToString(ar) === '[object Array]');
|
||||
}
|
||||
|
||||
function isRegExp(re) {
|
||||
return typeof re === 'object' && objectToString(re) === '[object RegExp]';
|
||||
}
|
||||
|
||||
function isDate(d) {
|
||||
return typeof d === 'object' && objectToString(d) === '[object Date]';
|
||||
}
|
||||
|
||||
function isError(e) {
|
||||
return typeof e === 'object' && objectToString(e) === '[object Error]';
|
||||
}
|
||||
|
||||
function objectToString(o) {
|
||||
return Object.prototype.toString.call(o);
|
||||
}
|
26
node_modules/chai/lib/chai/utils/isNaN.js
generated
vendored
Normal file
26
node_modules/chai/lib/chai/utils/isNaN.js
generated
vendored
Normal file
@ -0,0 +1,26 @@
|
||||
/*!
|
||||
* Chai - isNaN utility
|
||||
* Copyright(c) 2012-2015 Sakthipriyan Vairamani <thechargingvolcano@gmail.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* ### .isNaN(value)
|
||||
*
|
||||
* Checks if the given value is NaN or not.
|
||||
*
|
||||
* utils.isNaN(NaN); // true
|
||||
*
|
||||
* @param {Value} The value which has to be checked if it is NaN
|
||||
* @name isNaN
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function isNaN(value) {
|
||||
// Refer http://www.ecma-international.org/ecma-262/6.0/#sec-isnan-number
|
||||
// section's NOTE.
|
||||
return value !== value;
|
||||
}
|
||||
|
||||
// If ECMAScript 6's Number.isNaN is present, prefer that.
|
||||
module.exports = Number.isNaN || isNaN;
|
24
node_modules/chai/lib/chai/utils/isProxyEnabled.js
generated
vendored
Normal file
24
node_modules/chai/lib/chai/utils/isProxyEnabled.js
generated
vendored
Normal file
@ -0,0 +1,24 @@
|
||||
var config = require('../config');
|
||||
|
||||
/*!
|
||||
* Chai - isProxyEnabled helper
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* ### .isProxyEnabled()
|
||||
*
|
||||
* Helper function to check if Chai's proxy protection feature is enabled. If
|
||||
* proxies are unsupported or disabled via the user's Chai config, then return
|
||||
* false. Otherwise, return true.
|
||||
*
|
||||
* @namespace Utils
|
||||
* @name isProxyEnabled
|
||||
*/
|
||||
|
||||
module.exports = function isProxyEnabled() {
|
||||
return config.useProxy &&
|
||||
typeof Proxy !== 'undefined' &&
|
||||
typeof Reflect !== 'undefined';
|
||||
};
|
50
node_modules/chai/lib/chai/utils/objDisplay.js
generated
vendored
Normal file
50
node_modules/chai/lib/chai/utils/objDisplay.js
generated
vendored
Normal file
@ -0,0 +1,50 @@
|
||||
/*!
|
||||
* Chai - flag utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var inspect = require('./inspect');
|
||||
var config = require('../config');
|
||||
|
||||
/**
|
||||
* ### .objDisplay(object)
|
||||
*
|
||||
* Determines if an object or an array matches
|
||||
* criteria to be inspected in-line for error
|
||||
* messages or should be truncated.
|
||||
*
|
||||
* @param {Mixed} javascript object to inspect
|
||||
* @name objDisplay
|
||||
* @namespace Utils
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function objDisplay(obj) {
|
||||
var str = inspect(obj)
|
||||
, type = Object.prototype.toString.call(obj);
|
||||
|
||||
if (config.truncateThreshold && str.length >= config.truncateThreshold) {
|
||||
if (type === '[object Function]') {
|
||||
return !obj.name || obj.name === ''
|
||||
? '[Function]'
|
||||
: '[Function: ' + obj.name + ']';
|
||||
} else if (type === '[object Array]') {
|
||||
return '[ Array(' + obj.length + ') ]';
|
||||
} else if (type === '[object Object]') {
|
||||
var keys = Object.keys(obj)
|
||||
, kstr = keys.length > 2
|
||||
? keys.splice(0, 2).join(', ') + ', ...'
|
||||
: keys.join(', ');
|
||||
return '{ Object (' + kstr + ') }';
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
} else {
|
||||
return str;
|
||||
}
|
||||
};
|
69
node_modules/chai/lib/chai/utils/overwriteChainableMethod.js
generated
vendored
Normal file
69
node_modules/chai/lib/chai/utils/overwriteChainableMethod.js
generated
vendored
Normal file
@ -0,0 +1,69 @@
|
||||
/*!
|
||||
* Chai - overwriteChainableMethod utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
var chai = require('../../chai');
|
||||
var transferFlags = require('./transferFlags');
|
||||
|
||||
/**
|
||||
* ### .overwriteChainableMethod(ctx, name, method, chainingBehavior)
|
||||
*
|
||||
* Overwrites an already existing chainable method
|
||||
* and provides access to the previous function or
|
||||
* property. Must return functions to be used for
|
||||
* name.
|
||||
*
|
||||
* utils.overwriteChainableMethod(chai.Assertion.prototype, 'lengthOf',
|
||||
* function (_super) {
|
||||
* }
|
||||
* , function (_super) {
|
||||
* }
|
||||
* );
|
||||
*
|
||||
* Can also be accessed directly from `chai.Assertion`.
|
||||
*
|
||||
* chai.Assertion.overwriteChainableMethod('foo', fn, fn);
|
||||
*
|
||||
* Then can be used as any other assertion.
|
||||
*
|
||||
* expect(myFoo).to.have.lengthOf(3);
|
||||
* expect(myFoo).to.have.lengthOf.above(3);
|
||||
*
|
||||
* @param {Object} ctx object whose method / property is to be overwritten
|
||||
* @param {String} name of method / property to overwrite
|
||||
* @param {Function} method function that returns a function to be used for name
|
||||
* @param {Function} chainingBehavior function that returns a function to be used for property
|
||||
* @namespace Utils
|
||||
* @name overwriteChainableMethod
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function overwriteChainableMethod(ctx, name, method, chainingBehavior) {
|
||||
var chainableBehavior = ctx.__methods[name];
|
||||
|
||||
var _chainingBehavior = chainableBehavior.chainingBehavior;
|
||||
chainableBehavior.chainingBehavior = function overwritingChainableMethodGetter() {
|
||||
var result = chainingBehavior(_chainingBehavior).call(this);
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
|
||||
var newAssertion = new chai.Assertion();
|
||||
transferFlags(this, newAssertion);
|
||||
return newAssertion;
|
||||
};
|
||||
|
||||
var _method = chainableBehavior.method;
|
||||
chainableBehavior.method = function overwritingChainableMethodWrapper() {
|
||||
var result = method(_method).apply(this, arguments);
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
|
||||
var newAssertion = new chai.Assertion();
|
||||
transferFlags(this, newAssertion);
|
||||
return newAssertion;
|
||||
};
|
||||
};
|
92
node_modules/chai/lib/chai/utils/overwriteMethod.js
generated
vendored
Normal file
92
node_modules/chai/lib/chai/utils/overwriteMethod.js
generated
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
/*!
|
||||
* Chai - overwriteMethod utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
var addLengthGuard = require('./addLengthGuard');
|
||||
var chai = require('../../chai');
|
||||
var flag = require('./flag');
|
||||
var proxify = require('./proxify');
|
||||
var transferFlags = require('./transferFlags');
|
||||
|
||||
/**
|
||||
* ### .overwriteMethod(ctx, name, fn)
|
||||
*
|
||||
* Overwrites an already existing method and provides
|
||||
* access to previous function. Must return function
|
||||
* to be used for name.
|
||||
*
|
||||
* utils.overwriteMethod(chai.Assertion.prototype, 'equal', function (_super) {
|
||||
* return function (str) {
|
||||
* var obj = utils.flag(this, 'object');
|
||||
* if (obj instanceof Foo) {
|
||||
* new chai.Assertion(obj.value).to.equal(str);
|
||||
* } else {
|
||||
* _super.apply(this, arguments);
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
* Can also be accessed directly from `chai.Assertion`.
|
||||
*
|
||||
* chai.Assertion.overwriteMethod('foo', fn);
|
||||
*
|
||||
* Then can be used as any other assertion.
|
||||
*
|
||||
* expect(myFoo).to.equal('bar');
|
||||
*
|
||||
* @param {Object} ctx object whose method is to be overwritten
|
||||
* @param {String} name of method to overwrite
|
||||
* @param {Function} method function that returns a function to be used for name
|
||||
* @namespace Utils
|
||||
* @name overwriteMethod
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function overwriteMethod(ctx, name, method) {
|
||||
var _method = ctx[name]
|
||||
, _super = function () {
|
||||
throw new Error(name + ' is not a function');
|
||||
};
|
||||
|
||||
if (_method && 'function' === typeof _method)
|
||||
_super = _method;
|
||||
|
||||
var overwritingMethodWrapper = function () {
|
||||
// Setting the `ssfi` flag to `overwritingMethodWrapper` causes this
|
||||
// function to be the starting point for removing implementation frames from
|
||||
// the stack trace of a failed assertion.
|
||||
//
|
||||
// However, we only want to use this function as the starting point if the
|
||||
// `lockSsfi` flag isn't set.
|
||||
//
|
||||
// If the `lockSsfi` flag is set, then either this assertion has been
|
||||
// overwritten by another assertion, or this assertion is being invoked from
|
||||
// inside of another assertion. In the first case, the `ssfi` flag has
|
||||
// already been set by the overwriting assertion. In the second case, the
|
||||
// `ssfi` flag has already been set by the outer assertion.
|
||||
if (!flag(this, 'lockSsfi')) {
|
||||
flag(this, 'ssfi', overwritingMethodWrapper);
|
||||
}
|
||||
|
||||
// Setting the `lockSsfi` flag to `true` prevents the overwritten assertion
|
||||
// from changing the `ssfi` flag. By this point, the `ssfi` flag is already
|
||||
// set to the correct starting point for this assertion.
|
||||
var origLockSsfi = flag(this, 'lockSsfi');
|
||||
flag(this, 'lockSsfi', true);
|
||||
var result = method(_super).apply(this, arguments);
|
||||
flag(this, 'lockSsfi', origLockSsfi);
|
||||
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
|
||||
var newAssertion = new chai.Assertion();
|
||||
transferFlags(this, newAssertion);
|
||||
return newAssertion;
|
||||
}
|
||||
|
||||
addLengthGuard(overwritingMethodWrapper, name, false);
|
||||
ctx[name] = proxify(overwritingMethodWrapper, name);
|
||||
};
|
92
node_modules/chai/lib/chai/utils/overwriteProperty.js
generated
vendored
Normal file
92
node_modules/chai/lib/chai/utils/overwriteProperty.js
generated
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
/*!
|
||||
* Chai - overwriteProperty utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
var chai = require('../../chai');
|
||||
var flag = require('./flag');
|
||||
var isProxyEnabled = require('./isProxyEnabled');
|
||||
var transferFlags = require('./transferFlags');
|
||||
|
||||
/**
|
||||
* ### .overwriteProperty(ctx, name, fn)
|
||||
*
|
||||
* Overwrites an already existing property getter and provides
|
||||
* access to previous value. Must return function to use as getter.
|
||||
*
|
||||
* utils.overwriteProperty(chai.Assertion.prototype, 'ok', function (_super) {
|
||||
* return function () {
|
||||
* var obj = utils.flag(this, 'object');
|
||||
* if (obj instanceof Foo) {
|
||||
* new chai.Assertion(obj.name).to.equal('bar');
|
||||
* } else {
|
||||
* _super.call(this);
|
||||
* }
|
||||
* }
|
||||
* });
|
||||
*
|
||||
*
|
||||
* Can also be accessed directly from `chai.Assertion`.
|
||||
*
|
||||
* chai.Assertion.overwriteProperty('foo', fn);
|
||||
*
|
||||
* Then can be used as any other assertion.
|
||||
*
|
||||
* expect(myFoo).to.be.ok;
|
||||
*
|
||||
* @param {Object} ctx object whose property is to be overwritten
|
||||
* @param {String} name of property to overwrite
|
||||
* @param {Function} getter function that returns a getter function to be used for name
|
||||
* @namespace Utils
|
||||
* @name overwriteProperty
|
||||
* @api public
|
||||
*/
|
||||
|
||||
module.exports = function overwriteProperty(ctx, name, getter) {
|
||||
var _get = Object.getOwnPropertyDescriptor(ctx, name)
|
||||
, _super = function () {};
|
||||
|
||||
if (_get && 'function' === typeof _get.get)
|
||||
_super = _get.get
|
||||
|
||||
Object.defineProperty(ctx, name,
|
||||
{ get: function overwritingPropertyGetter() {
|
||||
// Setting the `ssfi` flag to `overwritingPropertyGetter` causes this
|
||||
// function to be the starting point for removing implementation frames
|
||||
// from the stack trace of a failed assertion.
|
||||
//
|
||||
// However, we only want to use this function as the starting point if
|
||||
// the `lockSsfi` flag isn't set and proxy protection is disabled.
|
||||
//
|
||||
// If the `lockSsfi` flag is set, then either this assertion has been
|
||||
// overwritten by another assertion, or this assertion is being invoked
|
||||
// from inside of another assertion. In the first case, the `ssfi` flag
|
||||
// has already been set by the overwriting assertion. In the second
|
||||
// case, the `ssfi` flag has already been set by the outer assertion.
|
||||
//
|
||||
// If proxy protection is enabled, then the `ssfi` flag has already been
|
||||
// set by the proxy getter.
|
||||
if (!isProxyEnabled() && !flag(this, 'lockSsfi')) {
|
||||
flag(this, 'ssfi', overwritingPropertyGetter);
|
||||
}
|
||||
|
||||
// Setting the `lockSsfi` flag to `true` prevents the overwritten
|
||||
// assertion from changing the `ssfi` flag. By this point, the `ssfi`
|
||||
// flag is already set to the correct starting point for this assertion.
|
||||
var origLockSsfi = flag(this, 'lockSsfi');
|
||||
flag(this, 'lockSsfi', true);
|
||||
var result = getter(_super).call(this);
|
||||
flag(this, 'lockSsfi', origLockSsfi);
|
||||
|
||||
if (result !== undefined) {
|
||||
return result;
|
||||
}
|
||||
|
||||
var newAssertion = new chai.Assertion();
|
||||
transferFlags(this, newAssertion);
|
||||
return newAssertion;
|
||||
}
|
||||
, configurable: true
|
||||
});
|
||||
};
|
147
node_modules/chai/lib/chai/utils/proxify.js
generated
vendored
Normal file
147
node_modules/chai/lib/chai/utils/proxify.js
generated
vendored
Normal file
@ -0,0 +1,147 @@
|
||||
var config = require('../config');
|
||||
var flag = require('./flag');
|
||||
var getProperties = require('./getProperties');
|
||||
var isProxyEnabled = require('./isProxyEnabled');
|
||||
|
||||
/*!
|
||||
* Chai - proxify utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* ### .proxify(object)
|
||||
*
|
||||
* Return a proxy of given object that throws an error when a non-existent
|
||||
* property is read. By default, the root cause is assumed to be a misspelled
|
||||
* property, and thus an attempt is made to offer a reasonable suggestion from
|
||||
* the list of existing properties. However, if a nonChainableMethodName is
|
||||
* provided, then the root cause is instead a failure to invoke a non-chainable
|
||||
* method prior to reading the non-existent property.
|
||||
*
|
||||
* If proxies are unsupported or disabled via the user's Chai config, then
|
||||
* return object without modification.
|
||||
*
|
||||
* @param {Object} obj
|
||||
* @param {String} nonChainableMethodName
|
||||
* @namespace Utils
|
||||
* @name proxify
|
||||
*/
|
||||
|
||||
var builtins = ['__flags', '__methods', '_obj', 'assert'];
|
||||
|
||||
module.exports = function proxify(obj, nonChainableMethodName) {
|
||||
if (!isProxyEnabled()) return obj;
|
||||
|
||||
return new Proxy(obj, {
|
||||
get: function proxyGetter(target, property) {
|
||||
// This check is here because we should not throw errors on Symbol properties
|
||||
// such as `Symbol.toStringTag`.
|
||||
// The values for which an error should be thrown can be configured using
|
||||
// the `config.proxyExcludedKeys` setting.
|
||||
if (typeof property === 'string' &&
|
||||
config.proxyExcludedKeys.indexOf(property) === -1 &&
|
||||
!Reflect.has(target, property)) {
|
||||
// Special message for invalid property access of non-chainable methods.
|
||||
if (nonChainableMethodName) {
|
||||
throw Error('Invalid Chai property: ' + nonChainableMethodName + '.' +
|
||||
property + '. See docs for proper usage of "' +
|
||||
nonChainableMethodName + '".');
|
||||
}
|
||||
|
||||
// If the property is reasonably close to an existing Chai property,
|
||||
// suggest that property to the user. Only suggest properties with a
|
||||
// distance less than 4.
|
||||
var suggestion = null;
|
||||
var suggestionDistance = 4;
|
||||
getProperties(target).forEach(function(prop) {
|
||||
if (
|
||||
!Object.prototype.hasOwnProperty(prop) &&
|
||||
builtins.indexOf(prop) === -1
|
||||
) {
|
||||
var dist = stringDistanceCapped(
|
||||
property,
|
||||
prop,
|
||||
suggestionDistance
|
||||
);
|
||||
if (dist < suggestionDistance) {
|
||||
suggestion = prop;
|
||||
suggestionDistance = dist;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if (suggestion !== null) {
|
||||
throw Error('Invalid Chai property: ' + property +
|
||||
'. Did you mean "' + suggestion + '"?');
|
||||
} else {
|
||||
throw Error('Invalid Chai property: ' + property);
|
||||
}
|
||||
}
|
||||
|
||||
// Use this proxy getter as the starting point for removing implementation
|
||||
// frames from the stack trace of a failed assertion. For property
|
||||
// assertions, this prevents the proxy getter from showing up in the stack
|
||||
// trace since it's invoked before the property getter. For method and
|
||||
// chainable method assertions, this flag will end up getting changed to
|
||||
// the method wrapper, which is good since this frame will no longer be in
|
||||
// the stack once the method is invoked. Note that Chai builtin assertion
|
||||
// properties such as `__flags` are skipped since this is only meant to
|
||||
// capture the starting point of an assertion. This step is also skipped
|
||||
// if the `lockSsfi` flag is set, thus indicating that this assertion is
|
||||
// being called from within another assertion. In that case, the `ssfi`
|
||||
// flag is already set to the outer assertion's starting point.
|
||||
if (builtins.indexOf(property) === -1 && !flag(target, 'lockSsfi')) {
|
||||
flag(target, 'ssfi', proxyGetter);
|
||||
}
|
||||
|
||||
return Reflect.get(target, property);
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* # stringDistanceCapped(strA, strB, cap)
|
||||
* Return the Levenshtein distance between two strings, but no more than cap.
|
||||
* @param {string} strA
|
||||
* @param {string} strB
|
||||
* @param {number} number
|
||||
* @return {number} min(string distance between strA and strB, cap)
|
||||
* @api private
|
||||
*/
|
||||
|
||||
function stringDistanceCapped(strA, strB, cap) {
|
||||
if (Math.abs(strA.length - strB.length) >= cap) {
|
||||
return cap;
|
||||
}
|
||||
|
||||
var memo = [];
|
||||
// `memo` is a two-dimensional array containing distances.
|
||||
// memo[i][j] is the distance between strA.slice(0, i) and
|
||||
// strB.slice(0, j).
|
||||
for (var i = 0; i <= strA.length; i++) {
|
||||
memo[i] = Array(strB.length + 1).fill(0);
|
||||
memo[i][0] = i;
|
||||
}
|
||||
for (var j = 0; j < strB.length; j++) {
|
||||
memo[0][j] = j;
|
||||
}
|
||||
|
||||
for (var i = 1; i <= strA.length; i++) {
|
||||
var ch = strA.charCodeAt(i - 1);
|
||||
for (var j = 1; j <= strB.length; j++) {
|
||||
if (Math.abs(i - j) >= cap) {
|
||||
memo[i][j] = cap;
|
||||
continue;
|
||||
}
|
||||
memo[i][j] = Math.min(
|
||||
memo[i - 1][j] + 1,
|
||||
memo[i][j - 1] + 1,
|
||||
memo[i - 1][j - 1] +
|
||||
(ch === strB.charCodeAt(j - 1) ? 0 : 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
return memo[strA.length][strB.length];
|
||||
}
|
28
node_modules/chai/lib/chai/utils/test.js
generated
vendored
Normal file
28
node_modules/chai/lib/chai/utils/test.js
generated
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
/*!
|
||||
* Chai - test utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Module dependencies
|
||||
*/
|
||||
|
||||
var flag = require('./flag');
|
||||
|
||||
/**
|
||||
* ### .test(object, expression)
|
||||
*
|
||||
* Test and object for expression.
|
||||
*
|
||||
* @param {Object} object (constructed Assertion)
|
||||
* @param {Arguments} chai.Assertion.prototype.assert arguments
|
||||
* @namespace Utils
|
||||
* @name test
|
||||
*/
|
||||
|
||||
module.exports = function test(obj, args) {
|
||||
var negate = flag(obj, 'negate')
|
||||
, expr = args[0];
|
||||
return negate ? !expr : expr;
|
||||
};
|
45
node_modules/chai/lib/chai/utils/transferFlags.js
generated
vendored
Normal file
45
node_modules/chai/lib/chai/utils/transferFlags.js
generated
vendored
Normal file
@ -0,0 +1,45 @@
|
||||
/*!
|
||||
* Chai - transferFlags utility
|
||||
* Copyright(c) 2012-2014 Jake Luer <jake@alogicalparadox.com>
|
||||
* MIT Licensed
|
||||
*/
|
||||
|
||||
/**
|
||||
* ### .transferFlags(assertion, object, includeAll = true)
|
||||
*
|
||||
* Transfer all the flags for `assertion` to `object`. If
|
||||
* `includeAll` is set to `false`, then the base Chai
|
||||
* assertion flags (namely `object`, `ssfi`, `lockSsfi`,
|
||||
* and `message`) will not be transferred.
|
||||
*
|
||||
*
|
||||
* var newAssertion = new Assertion();
|
||||
* utils.transferFlags(assertion, newAssertion);
|
||||
*
|
||||
* var anotherAssertion = new Assertion(myObj);
|
||||
* utils.transferFlags(assertion, anotherAssertion, false);
|
||||
*
|
||||
* @param {Assertion} assertion the assertion to transfer the flags from
|
||||
* @param {Object} object the object to transfer the flags to; usually a new assertion
|
||||
* @param {Boolean} includeAll
|
||||
* @namespace Utils
|
||||
* @name transferFlags
|
||||
* @api private
|
||||
*/
|
||||
|
||||
module.exports = function transferFlags(assertion, object, includeAll) {
|
||||
var flags = assertion.__flags || (assertion.__flags = Object.create(null));
|
||||
|
||||
if (!object.__flags) {
|
||||
object.__flags = Object.create(null);
|
||||
}
|
||||
|
||||
includeAll = arguments.length === 3 ? includeAll : true;
|
||||
|
||||
for (var flag in flags) {
|
||||
if (includeAll ||
|
||||
(flag !== 'object' && flag !== 'ssfi' && flag !== 'lockSsfi' && flag != 'message')) {
|
||||
object.__flags[flag] = flags[flag];
|
||||
}
|
||||
}
|
||||
};
|
97
node_modules/chai/package.json
generated
vendored
Normal file
97
node_modules/chai/package.json
generated
vendored
Normal file
@ -0,0 +1,97 @@
|
||||
{
|
||||
"_from": "chai@^4.2.0",
|
||||
"_id": "chai@4.2.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==",
|
||||
"_location": "/chai",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "range",
|
||||
"registry": true,
|
||||
"raw": "chai@^4.2.0",
|
||||
"name": "chai",
|
||||
"escapedName": "chai",
|
||||
"rawSpec": "^4.2.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "^4.2.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"#DEV:/",
|
||||
"#USER"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz",
|
||||
"_shasum": "760aa72cf20e3795e84b12877ce0e83737aa29e5",
|
||||
"_spec": "chai@^4.2.0",
|
||||
"_where": "/Users/josh.burman/Projects/braid",
|
||||
"author": {
|
||||
"name": "Jake Luer",
|
||||
"email": "jake@alogicalparadox.com"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/chaijs/chai/issues"
|
||||
},
|
||||
"bundleDependencies": false,
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Jake Luer",
|
||||
"email": "jake@alogicalparadox.com"
|
||||
},
|
||||
{
|
||||
"name": "Domenic Denicola",
|
||||
"email": "domenic@domenicdenicola.com",
|
||||
"url": "http://domenicdenicola.com"
|
||||
},
|
||||
{
|
||||
"name": "Veselin Todorov",
|
||||
"email": "hi@vesln.com"
|
||||
},
|
||||
{
|
||||
"name": "John Firebaugh",
|
||||
"email": "john.firebaugh@gmail.com"
|
||||
}
|
||||
],
|
||||
"dependencies": {
|
||||
"assertion-error": "^1.1.0",
|
||||
"check-error": "^1.0.2",
|
||||
"deep-eql": "^3.0.1",
|
||||
"get-func-name": "^2.0.0",
|
||||
"pathval": "^1.1.0",
|
||||
"type-detect": "^4.0.5"
|
||||
},
|
||||
"deprecated": false,
|
||||
"description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.",
|
||||
"devDependencies": {
|
||||
"browserify": "^16.0.0",
|
||||
"bump-cli": "^1.1.3",
|
||||
"codecov": "^3.0.0",
|
||||
"istanbul": "^0.4.3",
|
||||
"karma": "^2.0.0",
|
||||
"karma-firefox-launcher": "^1.0.0",
|
||||
"karma-mocha": "^1.0.1",
|
||||
"karma-phantomjs-launcher": "^1.0.0",
|
||||
"karma-sauce-launcher": "^1.2.0",
|
||||
"mocha": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=4"
|
||||
},
|
||||
"homepage": "http://chaijs.com",
|
||||
"keywords": [
|
||||
"test",
|
||||
"assertion",
|
||||
"assert",
|
||||
"testing",
|
||||
"chai"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./index",
|
||||
"name": "chai",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/chaijs/chai.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "make test"
|
||||
},
|
||||
"version": "4.2.0"
|
||||
}
|
1
node_modules/chai/register-assert.js
generated
vendored
Normal file
1
node_modules/chai/register-assert.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
global.assert = require('./').assert;
|
1
node_modules/chai/register-expect.js
generated
vendored
Normal file
1
node_modules/chai/register-expect.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
global.expect = require('./').expect;
|
1
node_modules/chai/register-should.js
generated
vendored
Normal file
1
node_modules/chai/register-should.js
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
global.should = require('./').should();
|
102
node_modules/chai/sauce.browsers.js
generated
vendored
Normal file
102
node_modules/chai/sauce.browsers.js
generated
vendored
Normal file
@ -0,0 +1,102 @@
|
||||
|
||||
/*!
|
||||
* Chrome
|
||||
*/
|
||||
|
||||
exports['SL_Chrome'] = {
|
||||
base: 'SauceLabs'
|
||||
, browserName: 'chrome'
|
||||
};
|
||||
|
||||
/*!
|
||||
* Firefox
|
||||
*/
|
||||
|
||||
exports['SL_Firefox'] = {
|
||||
base: 'SauceLabs'
|
||||
, browserName: 'firefox'
|
||||
};
|
||||
|
||||
exports['SL_Firefox_ESR'] = {
|
||||
base: 'SauceLabs'
|
||||
, browserName: 'firefox'
|
||||
, version: 38
|
||||
};
|
||||
|
||||
/*!
|
||||
* Internet Explorer
|
||||
*/
|
||||
|
||||
exports['SL_IE'] = {
|
||||
base: 'SauceLabs'
|
||||
, browserName: 'internet explorer'
|
||||
};
|
||||
|
||||
exports['SL_IE_Old'] = {
|
||||
base: 'SauceLabs'
|
||||
, browserName: 'internet explorer'
|
||||
, version: 10
|
||||
};
|
||||
|
||||
exports['SL_Edge'] = {
|
||||
base: 'SauceLabs'
|
||||
, browserName: 'microsoftedge'
|
||||
};
|
||||
|
||||
/*!
|
||||
* Safari
|
||||
*/
|
||||
|
||||
exports['SL_Safari'] = {
|
||||
base: 'SauceLabs'
|
||||
, browserName: 'safari'
|
||||
, platform: 'Mac 10.11'
|
||||
};
|
||||
|
||||
/*!
|
||||
* iPhone
|
||||
*/
|
||||
|
||||
/*!
|
||||
* TODO: These take forever to boot or shut down. Causes timeout.
|
||||
*
|
||||
|
||||
exports['SL_iPhone_6'] = {
|
||||
base: 'SauceLabs'
|
||||
, browserName: 'iphone'
|
||||
, platform: 'Mac 10.8'
|
||||
, version: '6'
|
||||
};
|
||||
|
||||
exports['SL_iPhone_5-1'] = {
|
||||
base: 'SauceLabs'
|
||||
, browserName: 'iphone'
|
||||
, platform: 'Mac 10.8'
|
||||
, version: '5.1'
|
||||
};
|
||||
|
||||
exports['SL_iPhone_5'] = {
|
||||
base: 'SauceLabs'
|
||||
, browserName: 'iphone'
|
||||
, platform: 'Mac 10.6'
|
||||
, version: '5'
|
||||
};
|
||||
|
||||
*/
|
||||
|
||||
/*!
|
||||
* Android
|
||||
*/
|
||||
|
||||
/*!
|
||||
* TODO: fails because of error serialization
|
||||
*
|
||||
|
||||
exports['SL_Android_4'] = {
|
||||
base: 'SauceLabs'
|
||||
, browserName: 'android'
|
||||
, platform: 'Linux'
|
||||
, version: '4'
|
||||
};
|
||||
|
||||
*/
|
Reference in New Issue
Block a user