Jasmine (JavaScript)
Jasmine Core | |
---|---|
Basisdaten
| |
Entwickler | Pivotal Labs (EMC Corporation) |
Erscheinungsjahr | 12. August 2009 |
Aktuelle Version | 2.0 (16. Dezember 2013) |
Betriebssystem | plattformunabhängig |
Programmiersprache | JavaScript |
Kategorie | Modultest |
Lizenz | MIT-Lizenz (Freie Software) |
deutschsprachig | nein |
jasmine.github.io |
Jasmine (Jasmine Core) ist eine freie Modultest-Bibliothek für JavaScript. Es wurde mit den Zielen erstellt, auf jeder JavaScript-fähigen Plattform ausführbar zu sein, ohne Änderung an Anwendung oder IDE jene von außen testen zu können und mit einer einfachen, selbstbeschreibenden Syntax auszukommen. Großen Einfluss auf die Entwicklung hatten andere Modultest-Bibliotheken wie ScrewUnit, JSSpec, JSpec, und RSpec.[1]
Einsatz
Jasmine aims to be easy to read. A simple hello world test looks like the code below, where describe() describes a suite of tests and it() is an individual test specification. The name "it()" follows the idea of behavior-driven development and serves as the first word in the test name, which should be a complete sentence.
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.