Added Polymer

This commit is contained in:
Thaum
2014-11-26 10:18:35 +00:00
parent 5eea4714b2
commit 3408ba9e8d
1210 changed files with 394645 additions and 47 deletions

View File

@@ -0,0 +1,37 @@
{
"name": "chai",
"version": "1.9.1",
"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": {},
"homepage": "https://github.com/chaijs/chai",
"_release": "1.9.1",
"_resolution": {
"type": "version",
"tag": "1.9.1",
"commit": "4180251dd45560f189192e28d3c0ba011f6d8178"
},
"_source": "git://github.com/chaijs/chai.git",
"_target": ">=1.8.1",
"_originalSource": "chai"
}

View File

@@ -0,0 +1,173 @@
# 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)
- [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** &mdash; check if the issue has already been reported.
2. **Check if the issue has been fixed** &mdash; try to reproduce it using the latest `master` or development branch in the repository.
3. **Isolate the problem** &mdash; 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. Locally merge (or rebase) the upstream development branch into your topic branch:
```bash
git pull [--rebase] upstream <dev-branch>
```
6. Push your topic branch up to your fork:
```bash
git push origin <topic-branch-name>
```
7. [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="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

View File

@@ -0,0 +1,895 @@
1.9.1 / 2014-03-19
==================
* deps update
* util: [getActual] select actual logic now allows undefined for actual. Closes #183
* docs: [config] make public, express param type
* Merge pull request #251 from romario333/threshold3
* Fix issue #166 - configurable threshold in objDisplay.
* Move configuration options to config.js.
* Merge pull request #233 from Empeeric/master
* Merge pull request #244 from leider/fix_for_contains
* Merge pull request #247 from didoarellano/typo-fixes
* Fix typos
* Merge pull request #245 from lfac-pt/patch-1
* Update `exports.version` to 1.9.0
* aborting loop on finding
* declaring variable only once
* additional test finds incomplete implementation
* simplified code
* fixing #239 (without changing chai.js)
* ssfi as it should be
* Merge pull request #228 from duncanbeevers/deep_members
* Deep equality check for collection membership
1.9.0 / 2014-01-29
==================
* docs: add contributing.md #238
* assert: .throws() returns thrown error. Closes #185
* Merge pull request #232 from laconbass/assert-throws
* assert: .fail() parameter mismatch. Closes #206
* Merge branch 'karma-fixes'
* Add karma phantomjs launcher
* Use latest karma and sauce launcher
* Karma tweaks
* Merge pull request #230 from jkroso/include
* Merge pull request #237 from chaijs/coverage
* Add coverage to npmignore
* Remove lib-cov from test-travisci dependents
* Remove the not longer needed lcov reporter
* Test coverage with istanbul
* Remove jscoverage
* Remove coveralls
* Merge pull request #226 from duncanbeevers/add_has
* Avoid error instantiation if possible on assert.throws
* Merge pull request #231 from duncanbeevers/update_copyright_year
* Update Copyright notices to 2014
* handle negation correctly
* add failing test case
* support `{a:1,b:2}.should.include({a:1})`
* Merge pull request #224 from vbardales/master
* Add `has` to language chains
* Merge pull request #219 from demands/overwrite_chainable
* return error on throw method to chain on error properties, possibly different from message
* util: store chainable behavior in a __methods object on ctx
* util: code style fix
* util: add overwriteChainableMethod utility (for #215)
* Merge pull request #217 from demands/test_cleanup
* test: make it possible to run utilities tests with --watch
* makefile: change location of karma-runner bin script
* Merge pull request #202 from andreineculau/patch-2
* test: add tests for throwing custom errors
* Merge pull request #201 from andreineculau/patch-1
* test: updated for the new assertion errors
* core: improve message for assertion errors (throw assertion)
1.8.1 / 2013-10-10
==================
* pkg: update deep-eql version
1.8.0 / 2013-09-18
==================
* test: [sauce] add a few more browsers
* Merge branch 'refactor/deep-equal'
* util: remove embedded deep equal utility
* util: replace embedded deep equal with external module
* Merge branch 'feature/karma'
* docs: add sauce badge to readme [ci skip]
* test: [sauce] use karma@canary to prevent timeouts
* travis: only run on node 0.10
* test: [karma] use karma phantomjs runner
* Merge pull request #181 from tricknotes/fix-highlight
* Fix highlight for example code
1.7.2 / 2013-06-27
==================
* coverage: add coveralls badge
* test: [coveralls] add coveralls api integration. testing travis-ci integration
* Merge branch 'master' of github.com:chaijs/chai
* Merge branch 'feature/bower'
* Merge pull request #180 from tricknotes/modify-method-title
* Merge pull request #179 from tricknotes/highlight-code-example
* Modify method title to include argument name
* Fix to highlight code example
* bower: granular ignores
1.7.1 / 2013-06-24
==================
* Merge branch 'feature/bower'. #175
* bower: add json file
* build: browser
1.7.0 / 2013-06-17
==================
* error: remove internal assertion error constructor
* core: [assertion-error] replace internal assertion error with dep
* deps: add chaijs/assertion-error@1.0.0
* docs: fix typo in source file. #174
* Merge pull request #174 from piecioshka/master
* typo
* Merge branch 'master' of github.com:chaijs/chai
* pkg: lock mocha/mocha-phantomjs versions (for now)
* Merge pull request #173 from chaijs/inspect-fix
* Fix `utils.inspect` with custom object-returning inspect()s.
* Merge pull request #171 from Bartvds/master
* replaced tabs with 2 spaces
* added assert.notOk()
* Merge pull request #169 from katsgeorgeek/topics/master
* Fix comparison objects.
1.6.1 / 2013-06-05
==================
* Merge pull request #168 from katsgeorgeek/topics/master
* Add test for different RegExp flags.
* Add test for regexp comparison.
* Downgrade mocha version for fix running Phantom tests.
* Fix comparison equality of two regexps.
* Merge pull request #161 from brandonpayton/master
* Fix documented name for assert interfaces isDefined method
1.6.0 / 2013-04-29
==================
* build: browser
* assert: [(not)include] throw on incompatible haystack. Closes #142
* assert: [notInclude] add assert.notInclude. Closes #158
* browser build
* makefile: force browser build on browser-test
* makefile: use component for browser build
* core: [assertions] remove extraneous comments
* Merge branch 'master' of github.com:chaijs/chai
* test: [assert] deep equal ordering
* Merge pull request #153 from NickHeiner/array-assertions
* giving members a no-flag assertion
* Code review comments - changing syntax
* Code review comments
* Adding members and memberEquals assertions for checking for subsets and set equality. Implements chaijs/chai#148.
* Merge pull request #140 from RubenVerborgh/function-prototype
* Restore the `call` and `apply` methods of Function when adding a chainable method.
* readme: 2013
* notes: migration notes for deep equal changes
* test: for ever err() there must be a passing version
1.5.0 / 2013-02-03
==================
* docs: add Release Notes for non-gitlog summary of changes.
* lib: update copyright to 2013
* Merge branch 'refactor/travis'
* makefile: remove test-component for full test run
* pkg: script test now runs make test so travis will test browser
* browser: build
* tests: refactor some tests to support new objDisplay output
* test: [bootstrap] normalize boostrap across all test scenarios
* assertions: refactor some assertions to use objDisplay instead of inspect
* util: [objDisplay] normalize output of functions
* makefile: refactor for full build scenarios
* component: fix build bug where missing util:type file
* assertions: [throw] code cleanup
* Merge branch 'refactor/typeDetection'
* browser: build
* makefile: chai.js is .PHONY so it builds every time
* test: [expect] add arguments type detection test
* core/assertions: [type] (a/an) refactor to use type detection utility
* util: add cross-browser type detection utility
* Merge branch 'feature/component'
* browser: build
* component: add component.json file
* makefile: refactor for fine grain control of testing scenarios
* test: add mochaPhantomJS support and component test file
* deps: add component and mocha-phantomjs for browser testing
* ignore: update ignore files for component support
* travis: run for all branches
* Merge branch 'feature/showDiff'
* test: [Assertion] configruable showDiff flag. Closes #132
* lib: [Assertion] add configurable showDiff flag. #132
* Merge branch 'feature/saucelabs'
* Merge branch 'master' into feature/saucelabs
* browser: build
* support: add mocha cloud runner, client, and html test page
* test: [saucelabs] add auth placeholder
* deps: add mocha-cloud
* Merge pull request #136 from whatthejeff/message_fix
* Merge pull request #138 from timnew/master
* Fix issue #137, test message existence by using message!=null rather than using message
* Fixed backwards negation messages.
* Merge pull request #133 from RubenVerborgh/throw
* Functions throwing strings can reliably be tested.
* Merge pull request #131 from RubenVerborgh/proto
* Cache whether __proto__ is supported.
* Use __proto__ if available.
* Determine the property names to exclude beforehand.
* Merge pull request #126 from RubenVerborgh/eqls
* Add alias eqls for eql.
* Use inherited enumerable properties in deep equality comparison.
* Show inherited properties when inspecting an object.
* Add new getProperties and getEnumerableProperties utils.
* showDiff: force true for equal and eql
1.4.2 / 2012-12-21
==================
* browser build: (object diff support when used with mocha) #106
* test: [display] array test for mocha object diff
* browser: no longer need different AssertionError constructor
1.4.1 / 2012-12-21
==================
* showDiff: force diff for equal and eql. #106
* test: [expect] type null. #122
* Merge pull request #115 from eshao/fix-assert-Throw
* FIX: assert.Throw checks error type/message
* TST: assert.Throw should check error type/message
1.4.0 / 2012-11-29
==================
* pre-release browser build
* clean up index.js to not check for cov, revert package.json to use index.js
* convert tests to use new bootstrap
* refactor testing bootstrap
* use spaces (not tabs). Clean up #114
* Merge pull request #114 from trantorLiu/master
* Add most() (alias: lte) and least() (alias: gte) to the API with new chainers "at" and "of".
* Change `main` to ./lib/chai. Fixes #28.
* Merge pull request #104 from connec/deep_equals_circular_references_
* Merge pull request #109 from nnarhinen/patch-1
* Check for 'actual' type
* Added support for circular references when checking deep (in)equality.
1.3.0 / 2012-10-01
==================
* browser build w/ folio >= 0.3.4. Closes #99
* add back buffer test for deep equal
* do not write flags to assertion.prototype
* remove buffer test from expect
* browser build
* improve documentation of custom error messages
* Merge branch 'master' of git://github.com/Liffft/chai into Liffft-master
* browser build
* improved buffer deep equal checking
* mocha is npm test command
* Cleaning up the js style…
* expect tests now include message pass-through
* packaging up browser-side changes…
* Increasing Throws error message verbosity
* Should syntax: piping message through
* Make globalShould test work in browser too.
* Add a setter for `Object.prototype.should`. Closes #86.
1.2.0 / 2012-08-07
==================
* Merge branch 'feature/errmsg'
* browser build
* comment updates for utilities
* tweak objDislay to only kick in if object inspection is too long
* Merge branch 'master' into feature/errmsg
* add display sample for error message refactor
* first draft of error message refactor. #93
* add `closeTo` assertion to `assert` interface. Closes #89.
* update folio build for better require.js handling. Closes #85
* Merge pull request #92 from paulmillr/topics/add-dom-checks
* Add check for DOM objects.
* browser build
* Merge branch 'master' of github.com:chaijs/chai
* bug - getActual not defaulting to assertion subject
* Merge pull request #88 from pwnall/master
* Don't inspect() assertion arguments if the assertion passes.
1.1.1 / 2012-07-09
==================
* improve commonjs support on browser build
* Merge pull request #83 from tkazec/equals
* Document .equals
* Add .equals as an alias of .equal
* remove unused browser prefix/suffix
* Merge branch 'feature/folio-build'
* browser build
* using folio to compile
* clean up makefile
* early folio 0.3.x support
1.1.0 / 2012-06-26
==================
* browser build
* Disable "Assertion.includeStack is false" test in IE.
* Use `utils.getName` for all function inspections.
* Merge pull request #80 from kilianc/closeTo
* fixes #79
* browser build
* expand docs to indicate change of subject for chaining. Closes #78
* add `that` chain noop
* Merge branch 'bug/74'
* comments on how to property use `length` as chain. Closes #74
* tests for length as chainable property. #74
* add support for `length` as chainable prop/method.
* Merge branch 'bug/77'
* tests for getPathValue when working with nested arrays. Closes #77
* add getPathValue support for nested arrays
* browser build
* fix bug for missing browser utils
* compile tool aware of new folder layout
* Merge branch 'refactor/1dot1'
* move core assertions to own file and refactor all using utils
* rearrange folder structure
1.0.4 / 2012-06-03
==================
* Merge pull request #68 from fizker/itself
* Added itself chain.
* simplify error inspections for cross browser compatibility
* fix safari `addChainableMethod` errors. Closes #69
1.0.3 / 2012-05-27
==================
* Point Travis badge to the right place.
* Make error message for eql/deep.equal more clear.
* Fix .not.deep.equal.
* contributors list
1.0.2 / 2012-05-26
==================
* Merge pull request #67 from chaijs/chaining-and-flags
* Browser build.
* Use `addChainableMethod` to get away from `__proto__` manipulation.
* New `addChainableMethod` utility.
* Replace `getAllFlags` with `transferFlags` utility.
* browser build
* test - get all flags
* utility - get all flags
* Add .mailmap to .npmignore.
* Add a .mailmap file to fix my name in shortlogs.
1.0.1 / 2012-05-18
==================
* browser build
* Fixing "an" vs. "a" grammar in type assertions.
* Uniformize `assert` interface inline docs.
* Don't use `instanceof` for `assert.isArray`.
* Add `deep` flag for equality and property value.
* Merge pull request #64 from chaijs/assertion-docs
* Uniformize assertion inline docs.
* Add npm-debug.log to .gitignore.
* no reserved words as actuals. #62
1.0.0 / 2012-05-15
==================
* readme cleanup
* browser build
* utility comments
* removed docs
* update to package.json
* docs build
* comments / docs updates
* plugins app cleanup
* Merge pull request #61 from joliss/doc
* Fix and improve documentation of assert.equal and friends
* browser build
* doc checkpoint - texture
* Update chai-jquery link
* Use defined return value of Assertion extension functions
* Update utility docs
1.0.0-rc3 / 2012-05-09
==================
* Merge branch 'feature/rc3'
* docs update
* browser build
* assert test conformity for minor refactor api
* assert minor refactor
* update util tests for new add/overwrite prop/method format
* added chai.Assertion.add/overwrite prop/method for plugin toolbox
* add/overwrite prop/method don't make assumptions about context
* doc test suite
* docs don't need coverage
* refactor all simple chains into one forEach loop, for clean documentation
* updated npm ignore
* remove old docs
* docs checkpoint - guide styled
* Merge pull request #59 from joliss/doc
* Document how to run the test suite
* don't need to rebuild docs to view
* dep update
* docs checkpoint - api section
* comment updates for docs
* new doc site checkpoint - plugin directory!
* Merge pull request #57 from kossnocorp/patch-1
* Fix typo: devDependancies → devDependencies
* Using message flag in `getMessage` util instead of old `msg` property.
* Adding self to package.json contributors.
* `getMessage` shouldn't choke on null/omitted messages.
* `return this` not necessary in example.
* `return this` not necessary in example.
* SinonChai has a dash
* updated plugins list for docs
1.0.0-rc2 / 2012-05-06
==================
* Merge branch 'feature/test-cov'
* browser build
* missing assert tests for ownProperty
* appropriate assert equivalent for expect.to.have.property(key, val)
* reset AssertionError to include full stack
* test for plugin utilities
* overwrite Property and Method now ensure chain
* version notes in readme
1.0.0-rc1 / 2012-05-04
==================
* browser build (rc1)
* assert match/notMatch tests
* assert interface - notMatch, ownProperty, notOwnProperty, ownPropertyVal, ownPropertyNotVal
* cleaner should interface export.
* added chai.Assertion.prototype._obj (getter) for quick access to object flag
* moved almostEqual / almostDeepEqual to stats plugin
* added mocha.opts
* Add test for `utils.addMethod`
* Fix a typo
* Add test for `utils.overwriteMethod`
* Fix a typo
* Browser build
* Add undefined assertion
* Add null assertion
* Fix an issue with `mocha --watch`
* travis no longer tests on node 0.4.x
* removing unnecissary carbon dep
* Merge branch 'feature/plugins-app'
* docs build
* templates for docs express app for plugin directory
* express app for plugin and static serving
* added web server deps
* Merge pull request #54 from josher19/master
* Remove old test.assert code
* Use util.inspect instead of inspect for deepAlmostEqual and almostEqual
* browser build
* Added almostEqual and deepAlmostEqual to assert test suite.
* bug - context determinants for utils
* dec=0 means rounding, so assert.deepAlmostEqual({pi: 3.1416}, {pi: 3}, 0) is true
* wrong travis link
* readme updates for version information
* travis tests 0.5.x branch as well
* [bug] util `addProperty` not correctly exporting
* read me version notes
* browser build 1.0.0alpha1
* not using reserved words in internal assertions. #52
* version tick
* clean up redundant tests
* Merge branch 'refs/heads/0.6.x'
* update version tag in package 1.0.0alpha1
* browser build
* added utility tests to browser specs
* beginning utility testing
* updated utility comments
* utility - overwriteMethod
* utility - overwriteProperty
* utility - addMethod
* utility - addProperty
* missing ;
* contributors list update
* Merge branch 'refs/heads/0.6.x-docs' into 0.6.x
* Added guide link to docs. WIP
* Include/contain are now both properties and methods
* Add an alias annotation
* Remove usless function wrapper
* Fix a typo
* A/an are now both properties and methods
* [docs] new site homepage layout / color checkpoint
* Ignore IE-specific error properties.
* Fixing order of error message test.
* New cross-browser `getName` util.
* Fixing up `AssertionError` inheritance.
* backup docs
* Add doctypes
* [bug] was still using `constructor.name` in `throw` assertion
* [bug] flag Object.create(null) instead of new Object
* [test] browser build
* [refactor] all usage of Assertion.prototype.assert now uses template tags and flags
* [refactor] remove Assertion.prototype.inspect for testable object inspection
* [refactor] object to test is now stored in flag, with ssfi and custom message
* [bug] flag util - don't return on `set`
* [docs] comments for getMessage utility
* [feature] getMessage
* [feature] testing utilities
* [refactor] flag doesn't require `call`
* Make order of source files well-defined
* Added support for throw(errorInstance).
* Use a foolproof method of grabbing an error's name.
* Removed constructor.name check from throw.
* disabled stackTrack configuration tests until api is stable again
* first version of line displayed error for node js (unstable)
* refactor core Assertion to use flag utility for negation
* added flag utility
* tests for assert interface negatives. Closed #42
* added assertion negatives that were missing. #42
* Support for expected and actual parameters in assert-style error object
* chai as promised - readme
* Added assert.fail. Closes #40
* better error message for assert.operator. Closes #39
* [refactor] Assertion#property to use getPathValue property
* added getPathValue utility helper
* removed todo about browser build
* version notes
* version bumb 0.6.0
* browser build
* [refactor] browser compile function to replace with `require('./error')' with 'require('./browser/error')'
* [feature] browser uses different error.js
* [refactor] error without chai.fail
* Assertion & interfaces use new utils helper export
* [refactor] primary export for new plugin util usage
* added util index.js helper
* added 2012 to copyright headers
* Added DeepEqual assertions
0.5.3 / 2012-04-21
==================
* Merge branch 'refs/heads/jgonera-oldbrowsers'
* browser build
* fixed reserved names for old browsers in interface/assert
* fixed reserved names for old browsers in interface/should
* fixed: chai.js no longer contains fail()
* fixed reserved names for old browsers in Assertion
* Merge pull request #49 from joliss/build-order
* Make order of source files well-defined
* Merge pull request #43 from zzen/patch-1
* Support for expected and actual parameters in assert-style error object
* chai as promised - readme
0.5.2 / 2012-03-21
==================
* browser build
* Merge branch 'feature/assert-fail'
* Added assert.fail. Closes #40
* Merge branch 'bug/operator-msg'
* better error message for assert.operator. Closes #39
* version notes
0.5.1 / 2012-03-14
==================
* chai.fail no longer exists
* Merge branch 'feature/assertdefined'
* Added asset#isDefined. Closes #37.
* dev docs update for Assertion#assert
0.5.0 / 2012-03-07
==================
* [bug] on inspect of reg on n 0.4.12
* Merge branch 'bug/33-throws'
* Merge pull request #35 from logicalparadox/empty-object
* browser build
* updated #throw docs
* Assertion#throw `should` tests updated
* Assertion#throw `expect` tests
* Should interface supports multiple throw parameters
* Update Assertion#throw to support strings and type checks.
* Add more tests for `empty` in `should`.
* Add more tests for `empty` in `expect`.
* Merge branch 'master' into empty-object
* don't switch act/exp
* Merge pull request #34 from logicalparadox/assert-operator
* Update the compiled verison.
* Add `assert.operator`.
* Notes on messages. #22
* browser build
* have been test
* below tests
* Merge branch 'feature/actexp'
* browser build
* remove unnecessary fail export
* full support for actual/expected where relevant
* Assertion.assert support expected value
* clean up error
* Update the compiled version.
* Add object & sane arguments support to `Assertion#empty`.
0.4.2 / 2012-02-28
==================
* fix for `process` not available in browser when used via browserify. Closes #28
* Merge pull request #31 from joliss/doc
* Document that "should" works in browsers other than IE
* Merge pull request #30 from logicalparadox/assert-tests
* Update the browser version of chai.
* Update `assert.doesNotThrow` test in order to check the use case when type is a string.
* Add test for `assert.ifError`.
* Falsey -> falsy.
* Full coverage for `assert.throws` and `assert.doesNotThrow`.
* Add test for `assert.doesNotThrow`.
* Add test for `assert.throws`.
* Add test for `assert.length`.
* Add test for `assert.include`.
* Add test for `assert.isBoolean`.
* Fix the implementation of `assert.isNumber`.
* Add test for `assert.isNumber`.
* Add test for `assert.isString`.
* Add test for `assert.isArray`.
* Add test for `assert.isUndefined`.
* Add test for `assert.isNotNull`.
* Fix `assert.isNotNull` implementation.
* Fix `assert.isNull` implementation.
* Add test for `assert.isNull`.
* Add test for `assert.notDeepEqual`.
* Add test for `assert.deepEqual`.
* Add test for `assert.notStrictEqual`.
* Add test for `assert.strictEqual`.
* Add test for `assert.notEqual`.
0.4.1 / 2012-02-26
==================
* Merge pull request #27 from logicalparadox/type-fix
* Update the browser version.
* Add should tests for type checks.
* Add function type check test.
* Add more type checks tests.
* Add test for `new Number` type check.
* Fix type of actual checks.
0.4.0 / 2012-02-25
==================
* docs and readme for upcoming 0.4.0
* docs generated
* putting coverage and tests for docs in docs/out/support
* make docs
* makefile copy necessary resources for tests in docs
* rename configuration test
* Merge pull request #21 from logicalparadox/close-to
* Update the browser version.
* Update `closeTo()` docs.
* Add `Assertion.closeTo()` method.
* Add `.closeTo()` should test.
* Add `.closeTo()` expect test.
* Merge pull request #20 from logicalparadox/satisfy
* Update the browser version.
* `..` -> `()` in `.satisfy()` should test.
* Update example for `.satisfy()`.
* Update the compiled browser version.
* Add `Assertion.satisfy()` method.
* Add `.satisfy()` should test.
* Add `.satisfy()` expect test.
* Merge pull request #19 from logicalparadox/respond-to
* Update the compiled browser version.
* Add `respondTo` Assertion.
* Add `respondTo` should test.
* Add `respondTo` expect test.
* Merge branch 'feature/coverage'
* mocha coverage support
* doc contributors
* README contributors
0.3.4 / 2012-02-23
==================
* inline comment typos for #15
* Merge branch 'refs/heads/jeffbski-configErrorStackCompat'
* includeStack documentation for all interfaces
* suite name more generic
* Update test to be compatible with browsers that do not support err.stack
* udpated compiled chai.js and added to browser tests
* Allow inclusion of stack trace for Assert error messages to be configurable
* docs sharing buttons
* sinon-chai link
* doc updates
* read me updates include plugins
0.3.3 / 2012-02-12
==================
* Merge pull request #14 from jfirebaugh/configurable_properties
* Make Assertion.prototype properties configurable
0.3.2 / 2012-02-10
==================
* codex version
* docs
* docs cleanup
0.3.1 / 2012-02-07
==================
* node 0.4.x compat
0.3.0 / 2012-02-07
==================
* Merge branch 'feature/03x'
* browser build
* remove html/json/headers testign
* regex error.message testing
* tests for using plugins
* Merge pull request #11 from domenic/master
* Make `chai.use` a no-op if the function has already been used.
0.2.4 / 2012-02-02
==================
* added in past tense switch for `been`
0.2.3 / 2012-02-01
==================
* try that again
0.2.2 / 2012-02-01
==================
* added `been` (past of `be`) alias
0.2.1 / 2012-01-29
==================
* added Throw, with a capital T, as an alias to `throw` (#7)
0.2.0 / 2012-01-26
==================
* update gitignore for vim *.swp
* Merge branch 'feature/plugins'
* browser build
* interfaces now work with use
* simple .use function. See #9.
* readme notice on browser compat
0.1.7 / 2012-01-25
==================
* added assert tests to browser test runner
* browser update
* `should` interface patch for primitives support in FF
* fix isObject() Thanks @milewise
* travis only on branch `master`
* add instanceof alias `instanceOf`. #6
* some tests for assert module
0.1.6 / 2012-01-02
==================
* commenting for assert interface
* updated codex dep
0.1.5 / 2012-01-02
==================
* browser tests pass
* type in should.not.equal
* test for should (not) exist
* added should.exist and should.not.exist
* browser uses tdd
* convert tests to tdd
0.1.4 / 2011-12-26
==================
* browser lib update for new assert interface compatiblitiy
* inspect typos
* added strict equal + negatives and ifError
* interface assert had doesNotThrow
* added should tests to browser
* new expect empty tests
* should test browser compat
* Fix typo for instanceof docs. Closes #3 [ci skip]
0.1.3 / 2011-12-18
==================
* much cleaner reporting string on error.
0.1.2 / 2011-12-18
==================
* [docs] for upcoming 0.1.2
* browser version built with pre/suffix … all tests passing
* make / compile now use prefix/suffix correctly
* code clean
* prefix/suffix to wrap browser output to prevent conflicts with other `require` methods.
* Merge branch 'feature/should4xcompatibility'
* compile for browser tests.. all pass
* added header/status/html/json
* throw tests
* should.throw & should.not.throw shortcuts
* improved `throw` type detection and messaging
* contain is now `include` … keys modifier is now `contain`
* removed object() test
* removed #respondTo
* Merge branch 'bug/2'
* replaced __defineGetter__ with defineProperty for all uses
* [docs] change mp tracking code
* docs site updated with assert (TDD) interface
* updated doc comments for assert interface
0.1.1 / 2011-12-16
==================
* docs ready for upcoming 0.1.1
* readme image fixed [ci skip]
* more readme tweaks [ci skip]
* réadmet image fixed [ci skip]
* documentation
* codex locked in version 0.0.5
* more comments to assertions for docs
* assertions fully commented, browser library updated
* adding codex as doc dependancy
* prepping for docs
* assertion component completely commented for documentation
* added exist test
* var expect outside of browser if check
* added keywords to package.json
0.1.0 / 2011-12-15
==================
* failing on purpose successful .. back to normal
* testing travis failure
* assert#arguments getter
* readme typo
* updated README
* added travis and npmignore
* copyright notices … think i got them all
* moved expect interface to own file for consistency
* assert ui deepEqual
* browser tests expect (all working)
* browser version built
* chai.fail (should ui)
* expect tests browser compatible
* tests for should and expect (all pass)
* moved fail to primary export
* should compatibility testing
* within, greaterThan, object, keys,
* Aliases
* Assertion#property now correctly works with negate and undefined values
* error message language matches should
* Assertion#respondTo
* Assertion now uses inspect util
* git ignore node modules
* should is exported
* AssertionError __proto__ from Error.prototype
* add should interface for should.js compatibility
* moved eql to until folder and added inspect from (joyent/node)
* added mocha for testing
* browser build for current api
* multiple .property assertions
* added deep equal from node
0.0.2 / 2011-12-07
==================
* cleaner output on error
* improved exists detection
* package remnant artifact
* empty deep equal
* test browser build
* assertion cleanup
* client compile script
* makefile
* most of the basic assertions
* allow no parameters to assertion error
* name change
* assertion error instance
* main exports: assert() & expect()
* initialize

View File

@@ -0,0 +1,99 @@
[![Chai Documentation](http://chaijs.com/public/img/chai-logo.png)](http://chaijs.com)
Chai is a BDD / TDD assertion library for [node](http://nodejs.org) and the browser that
can be delightfully paired with any javascript testing framework.
For more information or to download plugins, view the [documentation](http://chaijs.com).
[![Build Status](https://travis-ci.org/chaijs/chai.png?branch=master)](https://travis-ci.org/chaijs/chai)
[![Selenium Test Status](https://saucelabs.com/browser-matrix/chaijs.svg)](https://saucelabs.com/u/chaijs)
### 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).
- Have a plugin and want it listed? Open a Pull Request at [chaijs/chai-docs:plugin.js](https://github.com/chaijs/chai-docs/blob/master/plugins.js#L1-L12).
- Want to build a plugin? Read the [plugin api documentation](http://chaijs.com/guide/plugins/).
### Related Projects
- [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.
### Contributors
project : chai
repo age : 2 years, 3 months ago
commits : 756
active : 170 days
files : 57
authors :
540 Jake Luer 71.4%
79 Veselin Todorov 10.4%
43 Domenic Denicola 5.7%
6 Ruben Verborgh 0.8%
5 George Kats 0.7%
5 Jo Liss 0.7%
5 Juliusz Gonera 0.7%
5 Scott Nonnenberg 0.7%
5 leider 0.7%
4 John Firebaugh 0.5%
4 Max Edmands 0.5%
4 Nick Heiner 0.5%
4 josher19 0.5%
3 Andrei Neculau 0.4%
3 Duncan Beevers 0.4%
3 Jake Rosoman 0.4%
3 Jeff Barczewski 0.4%
3 Ryunosuke SATO 0.4%
3 Veselin 0.4%
2 Bartvds 0.3%
2 Edwin Shao 0.3%
2 Jakub Nešetřil 0.3%
2 Roman Masek 0.3%
2 Teddy Cross 0.3%
1 Anand Patil 0.1%
1 Benjamin Horsleben 0.1%
1 Brandon Payton 0.1%
1 Chris Connelly 0.1%
1 Chun-Yi 0.1%
1 DD 0.1%
1 Dido Arellano 0.1%
1 Jeff Welch 0.1%
1 Kilian Ciuffolo 0.1%
1 Luís Cardoso 0.1%
1 Niklas Närhinen 0.1%
1 Paul Miller 0.1%
1 Refael Ackermann 0.1%
1 Sasha Koss 0.1%
1 Victor Costan 0.1%
1 Vinay Pulim 0.1%
1 Virginie BARDALES 0.1%
1 laconbass 0.1%
1 piecioshka 0.1%
## License
(The MIT License)
Copyright (c) 2011-2014 Jake Luer <jake@alogicalparadox.com>
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.

View File

@@ -0,0 +1,482 @@
# Release Notes
## 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:
[![Selenium Test Status](https://saucelabs.com/browser-matrix/logicalparadox.svg)](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`.

View File

@@ -0,0 +1,27 @@
{
"name": "chai"
, "version": "1.9.1"
, "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": {}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,49 @@
{
"name": "chai"
, "repo": "chaijs/chai"
, "version": "1.9.1"
, "description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic."
, "license": "MIT"
, "keywords": [
"test"
, "assertion"
, "assert"
, "testing"
, "chai"
]
, "main": "index.js"
, "scripts": [
"index.js"
, "lib/chai.js"
, "lib/chai/assertion.js"
, "lib/chai/config.js"
, "lib/chai/core/assertions.js"
, "lib/chai/interface/assert.js"
, "lib/chai/interface/expect.js"
, "lib/chai/interface/should.js"
, "lib/chai/utils/addChainableMethod.js"
, "lib/chai/utils/addMethod.js"
, "lib/chai/utils/addProperty.js"
, "lib/chai/utils/flag.js"
, "lib/chai/utils/getActual.js"
, "lib/chai/utils/getEnumerableProperties.js"
, "lib/chai/utils/getMessage.js"
, "lib/chai/utils/getName.js"
, "lib/chai/utils/getPathValue.js"
, "lib/chai/utils/getProperties.js"
, "lib/chai/utils/index.js"
, "lib/chai/utils/inspect.js"
, "lib/chai/utils/objDisplay.js"
, "lib/chai/utils/overwriteMethod.js"
, "lib/chai/utils/overwriteProperty.js"
, "lib/chai/utils/overwriteChainableMethod.js"
, "lib/chai/utils/test.js"
, "lib/chai/utils/transferFlags.js"
, "lib/chai/utils/type.js"
]
, "dependencies": {
"chaijs/assertion-error": "1.0.0"
, "chaijs/deep-eql": "0.1.3"
}
, "development": {}
}

View File

@@ -0,0 +1,38 @@
/*
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
module.exports = function(config) {
config.set({
frameworks: [ 'mocha' ]
, files: [
'build/build.js'
, 'test/bootstrap/karma.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;
};
};

View File

@@ -0,0 +1,51 @@
/*
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
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.transports = [ 'xhr-polling' ];
config.sauceLabs = {
username: auth.SAUCE_USERNAME
, accessKey: auth.SAUCE_ACCESS_KEY
, startConnect: true
, tags: tags
, testName: 'ChaiJS'
, tunnelIdentifier: tunnel
};
};

View File

@@ -0,0 +1,42 @@
{
"author": "Jake Luer <jake@alogicalparadox.com>",
"name": "chai",
"description": "BDD/TDD assertion library for node.js and the browser. Test framework agnostic.",
"keywords": [ "test", "assertion", "assert", "testing", "chai" ],
"homepage": "http://chaijs.com",
"license": "MIT",
"contributors": [
"Jake Luer <jake@alogicalparadox.com>",
"Domenic Denicola <domenic@domenicdenicola.com> (http://domenicdenicola.com)",
"Veselin Todorov <hi@vesln.com>",
"John Firebaugh <john.firebaugh@gmail.com>"
],
"version": "1.9.1",
"repository": {
"type": "git",
"url": "https://github.com/chaijs/chai"
},
"bugs": {
"url": "https://github.com/chaijs/chai/issues"
},
"main": "./index",
"scripts": {
"test": "make test"
},
"engines": {
"node": ">= 0.4.0"
},
"dependencies": {
"assertion-error": "1.0.0"
, "deep-eql": "0.1.3"
},
"devDependencies": {
"component": "*"
, "karma": "0.12.x"
, "karma-mocha": "*"
, "karma-sauce-launcher": "0.2.x"
, "karma-phantomjs-launcher": "0.1.1"
, "mocha": "1.17.x"
, "istanbul": "0.2.x"
}
}

View File

@@ -0,0 +1,138 @@
/*
* @license
* Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
* This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt
* The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
* The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
* Code distributed by Google as part of the polymer project is also
* subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt
*/
/*!
* Chrome
*/
exports['SL_Chrome'] = {
base: 'SauceLabs'
, browserName: 'chrome'
};
/*!
* Firefox
*/
/*!
* TODO: Karma doesn't seem to like this, though sauce boots its up
*
exports['SL_Firefox_23'] = {
base: 'SauceLabs'
, browserName: 'firefox'
, platform: 'Windows XP'
, version: '23'
};
*/
exports['SL_Firefox_22'] = {
base: 'SauceLabs'
, browserName: 'firefox'
, platform: 'Windows 7'
, version: '22'
};
/*!
* Opera
*/
exports['SL_Opera_12'] = {
base: 'SauceLabs'
, browserName: 'opera'
, platform: 'Windows 7'
, version: '12'
};
exports['SL_Opera_11'] = {
base: 'SauceLabs'
, browserName: 'opera'
, platform: 'Windows 7'
, version: '11'
};
/*!
* Internet Explorer
*/
exports['SL_IE_10'] = {
base: 'SauceLabs'
, browserName: 'internet explorer'
, platform: 'Windows 2012'
, version: '10'
};
/*!
* Safari
*/
exports['SL_Safari_6'] = {
base: 'SauceLabs'
, browserName: 'safari'
, platform: 'Mac 10.8'
, version: '6'
};
exports['SL_Safari_5'] = {
base: 'SauceLabs'
, browserName: 'safari'
, platform: 'Mac 10.6'
, version: '5'
};
/*!
* 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'
};
*/