Movatterモバイル変換


[0]ホーム

URL:


Chai is a BDD / TDD assertion library fornode and the browser that can be delightfully paired with any javascript testing framework.

Download Chaiv5.1.1

for NodeAnother platform?BrowserRails

Thechai package is available on npm.
$ npm install chai
View Node Guide

for BrowserAnother platform?NodeRails

Thechai.js script is available for download or a hotlink.
Download chai.js View Browser Guide

for RailsAnother platform?NodeBrowser

Chai is available through Konacha, a modern test harness that takes full advantage of Rails 3 features such as the asset pipeline and engines.
Konacha GitHub Project
Getting StartedLearn how to install and use Chai through a series of guided walkthroughs.
API DocumentationExplore the BDD & TDD language specifications for all available assertions.
Plugin DirectoryExtend Chai's with additional assertions and vendor integration.

Chai has several interfaces that allow the developer to choose the most comfortable. The chain-capable BDD styles provide an expressive language & readable style, while the TDD assert style provides a more classical feel.

Should

chai.should();foo.should.be.a('string');foo.should.equal('bar');foo.should.have.lengthOf(3);tea.should.have.property('flavors').with.lengthOf(3);

Expect

varexpect=chai.expect;expect(foo).to.be.a('string');expect(foo).to.equal('bar');expect(foo).to.have.lengthOf(3);expect(tea).to.have.property('flavors').with.lengthOf(3);

[8]ページ先頭

©2009-2025 Movatter.jp