You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert
BDD The BDD styles are expect and should. Both use the same chainable language to construct assertions, but they differ in the way an assertion is initially constructed. Check out the Style Guide for a comparison. API Reference Language Chains The following are provided as chainable getters to improve the readability of your assertions. Chains to be been is that which and has have with at of same
Assert The assert style is very similar to node.js’ included assert module, with a bit of extra sugar. Of the three style options, assert is the only one that is not chainable. Check out the Style Guide for a comparison. API Reference assert(expression, message) @param { Mixed } expression to test for truthiness @param { String } message to display on error Write your own test expressions. assert(
Assertion Styles This section of the guide introduces you to the three different assertion styles that you may use in your testing environment. Once you have made your selection, it is recommended that you look at the API Documentation for your selected style. Assert View full Assert API The assert style is exposed through assert interface. This provides the classic assert-dot notation, similar to
API Reference The Chai API is broken down by style or task. Assertion Styles The Expect / Should API covers the BDD assertion styles. The Assert API covers the TDD assertion style. Plugins The Plugin API will be of use to anyone interested in building plugins as helpers to DRY up your tests, or for release to the community. Tools The Online Test Suite is a live run of Chai’s test suite. Use it to
Chai Assertions for Promises Chai as Promised extends Chai with a fluent language for asserting facts about promises. Instead of manually wiring up your expectations to a promise’s fulfilled and rejected handlers: doSomethingAsync().then( function (result) { result.should.equal("foo"); done(); }, function (err) { done(err); } );
chai-jquery chai-jquery is an extension to the chai assertion library that provides a set of jQuery-specific assertions. Usage Include chai-jquery.js in your test file, after jquery.js and chai.js (version 1.0.0-rc1 or later): <script src="jquery.js"></script> <script src="chai.js"></script> <script src="chai-jquery.js"></script> Note that jquery.js and chai.js can be inserted one before another (
chai-json-schema Chai plugin with assertions to validate values against JSON Schema v4. Assert both simple values and complex objects with the rich collection of validation terms (examples). For general help with json-schema see this excellent guide and usable reference. Notes JSON Schema validation is done by Tiny Validator tv4. It seems that tv4 is not actively developed anymore, nor does it sup
Unit testing framework for Javascript Unit.js is an assertion library for Javascript, running on Node.js and the browser. It works with any test runner and unit testing framework like Mocha, Jasmine, Karma, protractor (E2E test framework for Angular apps), QUnit, ... and more. Unit.js supports dependency injection and is extensible via a plugins system easy to use.
Mocha Mocha is a feature-rich JavaScript test framework running on Node.js and in the browser, making asynchronous testing simple and fun. Mocha tests run serially, allowing for flexible and accurate reporting, while mapping uncaught exceptions to the correct test cases. Mocha is free and open source, licensed under the MIT license. If you want to learn more on Mocha, see official Mocha documentat
Should.js API documentation Should.js is included in Unit.JS, you can use Should.js with Unit.js : var test = require('unit.js'); // test 'string' type test.should('foobar').be.type('string'); // then that actual value '==' expected value test.should('foobar' == 'foobar').be.ok; // then that actual value '===' expected value test.should('foobar').be.equal('foobar'); // Should.js library (alternati
AngularJSを利用したのなら、絶対にKarmaとか Protractorを活用すべきです。ちゅうか、活用しなさい。と言いたいです。システムを保守フェーズに安定的にメンテナンスするならそう考えるのがふつうになるべき。 (※Protractorについては、こちらの記事がとても参考になります) 例によって「Mastering web application development with AngularJS」を読んで書かれていたポイントを読んだ感想をこちらにまとめてますが、 2章のテスト解説部分に下記の文章があります。 There is a quote saying that writing code without a Version Control system (VCS) is like skydiving without a parachute. Today one would
Chai is a BDD / TDD assertion library for node and the browser that can be delightfully paired with any javascript testing framework.
This page is for an older version of Jasmine (2.0) The current stable version of Jasmine is: 3.10 - You can also look at the docs for the next release: Edge Jasmine is a behavior-driven development framework for testing JavaScript code. It does not depend on any other JavaScript frameworks. It does not require a DOM. And it has a clean, obvious syntax so that you can easily write tests. This guide
FAST Low overhead, jasmine-core has no external dependencies. NO MAGIC Jasmine specs are just JavaScript. Jasmine doesn't change the way your code loads or runs.
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く