https://github.com/princed/karma-expect
Expect.js adapter for Karma test runner
https://github.com/princed/karma-expect
assertions expect karma karma-plugin
Last synced: 8 months ago
JSON representation
Expect.js adapter for Karma test runner
- Host: GitHub
- URL: https://github.com/princed/karma-expect
- Owner: princed
- License: mit
- Created: 2013-07-23T11:35:55.000Z (almost 13 years ago)
- Default Branch: master
- Last Pushed: 2017-09-12T00:52:52.000Z (almost 9 years ago)
- Last Synced: 2025-06-05T07:38:50.175Z (about 1 year ago)
- Topics: assertions, expect, karma, karma-plugin
- Language: JavaScript
- Homepage:
- Size: 28.3 KB
- Stars: 12
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[karma](http://karma-runner.github.io)-[expect](https://github.com/Automattic/expect.js)
============
[](https://david-dm.org/princed/karma-expect) [](https://greenkeeper.io/) [](https://www.npmjs.com/package/karma-expect) [](https://www.npmjs.com/package/karma-expect) [](https://travis-ci.org/princed/karma-expect)
Motivation
----------
You should use it only if you want run tests in **IE8 and lower**, otherwise consider [karma-chai-plugins](https://github.com/princed/karma-chai-plugins/), which provides more complete [Chai](http://chaijs.com/) assertions as well as additional plugins.
Installation
------------
Install the module from npm:
```sh
$ npm install karma-expect --save-dev
```
Add `expect` to the `frameworks` key in your Karma configuration:
```js
module.exports = function(karma) {
karma.set({
// frameworks to use
frameworks: ['mocha', 'expect']
// ...
});
};
```
Usage
-----
Expect.js assertions are available in the tests:
```js
describe('karma tests with expect', function() {
it('should expose expect method', function() {
expect('foo').to.not.equal('bar');
});
});
```