Guide · Open source
How to use Jasmine: install, write specs and run tests
Updated · written with AI from the project's own documentation and checked against our catalogue data
Jasmine is an open-source testing framework for JavaScript, released under the MIT License. It is written in the behavior-driven development style, so tests read as plain descriptions of expected behavior. This guide is for JavaScript developers who want to test websites or Node.js projects and want to know how Jasmine is set up, what it needs, and where to find the details.
Quick start
- 1Check your environment. Confirm you have Node.js 20 or newer for Node-based projects, or a supported browser for browser testing.
- 2Get Jasmine. Clone the repository with git clone https://github.com/jasmine/jasmine.git, or follow the install method on the Getting Started page.
- 3Read the getting started material. Open the Getting Started page and the documentation site for setup details.
- 4Follow the first suite tutorial. Work through the Your First Suite tutorial to learn how to write suites and specs.
- 5Write readable specs. Describe the expected behavior of each piece of code in plain sentences inside your spec files.
- 6Check the release notes. Confirm that your chosen Jasmine release supports your browser or Node version.
What Jasmine is and where it runs
Jasmine is a Behavior Driven Development testing framework for JavaScript. According to its README, it does not rely on browsers, the DOM, or any JavaScript framework, so it can be used for websites, Node.js projects, or anywhere JavaScript can run.
Because tests are written as JavaScript code, Jasmine is a fit for developers rather than people looking for a no-code testing tool.
Install Jasmine
The README says there are several ways to install Jasmine, depending on your environment and how you want to use it. The full installation options are on the Getting Started page of the Jasmine website.
The README also shows how to get the source code by cloning the repository. Node.js 20 or newer is needed for Node-based projects, according to the supported environments table.
- Check your Node.js version. Node 20 is marked best-effort; Node 22, 24 and 26 are listed as supported.
- Read the Getting Started page for the install method that fits your project.
git clone https://github.com/jasmine/jasmine.gitWrite your first spec
Jasmine organizes tests into suites and specs. The README points to the Your First Suite tutorial on the documentation site as the reference for writing specs.
Read the tutorial and the documentation site for the exact syntax, since this guide does not reproduce it.
- Start with the Your First Suite tutorial on the Jasmine documentation site.
- Keep each spec description a plain sentence that says what the code should do.
Check which environments are supported
Jasmine tests itself in Safari, Chrome, Firefox, Microsoft Edge and Node. The table in the README lists Node 20 (best-effort), 22, 24 and 26; Safari 26 (best-effort); Chrome, Edge and Firefox on Evergreen versions; and Firefox 140.
Other browsers and other versions of some browsers are likely to work, but they are not tested or actively supported. To see which environments work with a specific release, check the release notes in the repository.
- Use the listed environments when you need predictable results.
- Treat best-effort entries as possibly dropped in future releases.
Find help and documentation
The README links to the documentation site, the Your First Suite tutorial and the FAQ. Before filing a problem, check the FAQ, since common questions are answered there.
If you want to contribute, the README links to the contributors' guide.
- Documentation site: jasmine.github.io/pages/docs_home.html
- FAQ: jasmine.github.io/pages/faq.html
- Contributors' guide: .github/CONTRIBUTING.md in the repository
What people use it for
- Testing a browser-based website's JavaScript behavior
- Testing a Node.js project's functions and modules
- Writing tests that a non-specialist can read as plain-language descriptions of expected behavior
- Running the same test framework in any environment where JavaScript runs
Frequently asked questions
Is Jasmine free to use?
Yes. Jasmine is released under the MIT License, as stated in the README. The license file is in the repository.
What do I need to run Jasmine?
For Node-based projects, the supported environments table lists Node 20 or newer. For browsers, the table lists Safari, Chrome, Firefox and Edge, with the versions shown there.
Does Jasmine need a browser or the DOM?
No. The README says Jasmine does not rely on browsers, the DOM, or any JavaScript framework, so it can be used for Node.js projects as well as websites.
How do I install Jasmine?
The README says there are several install methods depending on your environment. It points to the Getting Started page for details, and shows how to clone the repository with git clone.
Why does my Jasmine version not work with my browser?
The README says Jasmine is tested only against the listed environments. Other browsers and versions are likely to work but are not actively supported, so check the release notes for the version you installed.
How does Jasmine compare to Jest, Mocha or Vitest?
The source material does not compare these tools, so this guide cannot make a claim about differences. Compare them on the features and environments you need.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Jasmine suits JavaScript developers who want a behavior-driven framework with no extra dependencies, for browsers or Node.js. It is less suited to people who want a graphical testing tool, or to projects that need environments outside the listed, tested versions.
Install options & downloads