Jasmine (JavaScript framework)
Encyclopedia
Jasmine is an open source
Open source
The term open source describes practices in production and development that promote access to the end product's source materials. Some consider open source a philosophy, others consider it a pragmatic methodology...

 unit testing framework for JavaScript
JavaScript
JavaScript is a prototype-based scripting language that is dynamic, weakly typed and has first-class functions. It is a multi-paradigm language, supporting object-oriented, imperative, and functional programming styles....

. It aims to run on any JavaScript-enabled platform, to not intrude on the application nor the IDE
Integrated development environment
An integrated development environment is a software application that provides comprehensive facilities to computer programmers for software development...

, and to have easy-to-read syntax. It is heavily influenced by other unit testing frameworks, such as ScrewUnit, JSSpec, JSpec, and RSpec
RSpec
RSpec is a behavior driven development framework for the Ruby programming language, inspired by JBehave. It contains its own mocking framework that is fully integrated into the framework based upon JMock...

.

Usage

Jasmine aims to be easy to read. A simple hello world test looks like this:


describe('Hello world', function {
it('says hello', function {
expect(helloWorld).toEqual("Hello world!");
});
});


Jasmine has a number of other features, such as custom matchers, spies, and support for asynchronous specifications.

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK