LLMpediaThe first transparent, open encyclopedia generated by LLMs

Jasmine (testing framework)

Generated by GPT-5-mini
Note: This article was automatically generated by a large language model (LLM) from purely parametric knowledge (no retrieval). It may contain inaccuracies or hallucinations. This encyclopedia is part of a research project currently under review.
Article Genealogy
Parent: Ionic Framework Hop 5
Expansion Funnel Raw 80 → Dedup 0 → NER 0 → Enqueued 0
1. Extracted80
2. After dedup0 (None)
3. After NER0 ()
4. Enqueued0 ()
Jasmine (testing framework)
NameJasmine
DeveloperPivotal Software; contributors
Released2010
Programming languageJavaScript
PlatformCross-platform
LicenseMIT License

Jasmine (testing framework) is an open-source behavior-driven development framework for testing JavaScript code in web browsers and Node.js environments. It provides a clean syntax for writing specifications and assertions, enabling teams to validate functionality across user interfaces and server-side modules. Jasmine emphasizes simplicity and zero-configuration philosophy to facilitate rapid test-driven development in modern software projects.

Overview

Jasmine is a behavior-driven development framework originally created for testing JavaScript, frequently used alongside projects from organizations such as Pivotal Software, Google, Facebook, Microsoft, Mozilla, Amazon and Netflix. It supports running tests in environments including browsers like Google Chrome, Mozilla Firefox, Microsoft Edge and Safari and in server runtimes such as Node.js. Jasmine's design complements ecosystems around libraries and tools like React, Angular, Vue.js, jQuery, TypeScript, Webpack, Babel and ESLint. Prominent development workflows that adopt Jasmine include those influenced by practices from Extreme Programming, Agile software development teams at companies such as IBM and ThoughtWorks.

History and Development

Jasmine was created in 2010 by programmers seeking a test framework independent of browser DOM dependencies, emerging contemporaneously with projects from jQuery Foundation, Dojo Toolkit, Backbone.js and Prototype. Its evolution paralleled contributions from communities around Node.js, CommonJS, AMD and build systems like Grunt and Gulp. Over time, Jasmine integrated ideas from testing traditions established by tools such as JUnit, RSpec, Mocha and QUnit, while maintaining a distinctive syntax influenced by behavior-driven approaches promoted by figures associated with Kent Beck, Martin Fowler and organizations like ThoughtWorks. Major releases expanded compatibility with ECMAScript 6, TypeScript, and module systems used by companies including Netflix and PayPal.

Features and Architecture

Jasmine provides core features including spies, mocks, fixtures, asynchronous support, and clear reporting. Its architecture separates the test runner from the assertion library, enabling integration with continuous integration systems like Jenkins (software), Travis CI, CircleCI, GitHub Actions, GitLab CI and Azure DevOps. Jasmine's matcher set can be extended similarly to matcher libraries used in projects by Facebook and Google, and it interoperates with assertion styles practiced in environments maintained by Mozilla and Microsoft. The framework supports behavior-driven constructs analogous to those in RSpec and leverages patterns familiar to developers working with AngularJS and Angular. Its spy implementation offers features comparable to test doubles used by teams at Spotify and Uber Technologies.

Syntax and Usage

Jasmine expresses tests using describe/it blocks and expect matchers, echoing conventions found in BDD resources attributed to Dan North and Aslak Hellesøy. Example primitives include beforeEach, afterEach, beforeAll and afterAll for lifecycle management, patterns also used in frameworks popularized at Google and Facebook. As a test authoring choice, many teams using TypeScript or Babel compile test sources to integrate with tools from Webpack and Rollup, and to support transpiled codebases deployed by companies like Airbnb and LinkedIn. Jasmine's fluent API supports writing expressive assertions for DOM interactions tested in browsers like Google Chrome and server logic exercised in Node.js applications similar to services from Heroku and DigitalOcean.

Integration and Tooling

Jasmine integrates with IDEs and editors including Visual Studio Code, JetBrains WebStorm, Sublime Text, Atom and Vim through plugins and extensions maintained by communities around GitHub and npm. Build and CI integrations include adapters for Karma, task runners like Grunt and Gulp, and bundlers such as Webpack. Test reporting and coverage are often combined with tools like Istanbul/nyc, and dashboards provided by Codecov and Coveralls. Jasmine-based suites are commonly executed in virtualized and containerized environments orchestrated with Docker, Kubernetes and cloud CI services from CircleCI and Travis CI.

Comparison with Other Testing Frameworks

Compared to frameworks such as Mocha, Jest, AVA, Tape and QUnit, Jasmine offers an all-in-one package with built-in assertion and mocking facilities, reducing external dependencies similarly to the integrated approaches used by JUnit in the Java ecosystem. Teams choosing Jasmine often weigh trade-offs against features in Jest (snapshot testing popularized by Facebook), the plugin architecture of Mocha (favored at LinkedIn and Netflix), and the concurrency model of AVA (adopted in some GitHub projects). Organizations such as Google and Microsoft have influenced testing expectations for performance and maintainability, which factor into framework selection between Jasmine and alternatives.

Adoption and Notable Projects

Jasmine has been adopted across open-source and enterprise projects including frameworks and applications associated with Angular teams, developer tools from Ionic, corporate stacks at Pivotal Software and various web applications deployed by Airbnb, Uber Technologies, Netflix, PayPal and eBay. Its presence is notable in repositories hosted on GitHub and package management via npm, and it is used in educational resources and books published by outlets like O'Reilly Media, Manning Publications and Apress. Jasmine's community and contributors include developers affiliated with companies such as Pivotal Software, Google, Microsoft and ThoughtWorks.

Category:JavaScript testing frameworks