项目作者: seek-oss

项目描述 :
FORK: https://github.com/xdissent/karma-chai
高级语言: JavaScript
项目地址: git://github.com/seek-oss/karma-chai.git
创建时间: 2017-08-02T01:53:33Z
项目社区:https://github.com/seek-oss/karma-chai

开源协议:MIT License

下载


karma-chai

Chai for Karma

NPM version Dependency status devDependency Status

Installation

Install the plugin from npm:

  1. $ npm install karma-chai --save-dev

Or from Github:

  1. $ npm install 'git+https://github.com/xdissent/karma-chai.git' --save-dev

Add chai to the frameworks key in your Karma configuration:

  1. module.exports = (config) ->
  2. config.set
  3. # frameworks to use
  4. frameworks: ['mocha', 'chai']
  5. # chai config
  6. client: {
  7. chai: {
  8. includeStack: true
  9. }
  10. }
  11. # ...

Usage

Each of the different Chai assertion suites is available in the tests:

  1. describe 'karma tests with chai', ->
  2. it 'should expose the Chai assert method', ->
  3. assert.ok('everything', 'everything is ok');
  4. it 'should expose the Chai expect method', ->
  5. expect('foo').to.not.equal 'bar'
  6. it 'should expose the Chai should property', ->
  7. 1.should.not.equal 2
  8. should.exist 123

License

The MIT License (MIT)