PACKAGE · TESTING

jasmine-core

Simple JavaScript testing framework for browsers and node.js

WEEKLY DOWNLOADS 2.6M
STARS 15.8K
FORKS 2.2K
OPEN ISSUES 9
GZIP SIZE 33.8 kB
UNPACKED SIZE 460.8 kB
DEPENDENCIES 1
LAST UPDATED 3mo ago
DOWNLOAD TRENDS

jasmine-core downloads — last 12 months

Download trends for jasmine-core1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.06.6M13.3M19.9M26.5MJun 2025SepDecMarMay 2026
jasmine-core
ABOUT JASMINE-CORE

Jasmine Core provides a Behavior-Driven Development (BDD) testing framework for JavaScript, designed to help developers write cleaner, more maintainable code through a clear specification of behavior. It solves the problem of asserting code correctness and expected outcomes in a structured, human-readable format, facilitating a collaborative approach to software development.

Its core philosophy centers around readability and simplicity, making it accessible to developers of all experience levels. Jasmine aims to provide a complete, zero-dependency testing experience with a focus on expressiveness in test suites, catering to frontend and backend JavaScript projects that benefit from clear test specifications.

The framework exposes a domain-specific language (DSL) with global functions like `describe`, `it`, `expect`, `beforeEach`, and `afterEach`. These functions enable the organization of tests into logical suites and individual specifications, with `expect` providing a fluent API for making assertions against actual values using matchers like `toBe` or `toEqual`.

Jasmine Core integrates seamlessly into various JavaScript development workflows. It can be run directly in Node.js environments or used within browser testing setups, often paired with test runners like Karma or dedicated CI/CD pipelines for automated execution. Its independence from external dependencies simplifies setup and integration.

With a bundle size of 33.8 kB (gzip), Jasmine Core offers a relatively compact footprint for a comprehensive testing framework. It has a long history and has been actively maintained, evidenced by version 6.2.0 and recent updates, providing a mature and stable testing solution trusted by a large community, indicated by 5.3M weekly downloads.

While Jasmine provides a robust testing environment, developers should note that its global nature might require specific configurations in module-based bundlers or transpilers. The framework's design assumes a certain level of browser or Node.js environment availability, which might influence its suitability for highly specialized or embedded JavaScript contexts not adhering to standard execution environments.

WHEN TO USE
  • When you need to specify and test JavaScript code behavior using a Behavior-Driven Development (BDD) approach with clear, human-readable syntax.
  • When organizing tests into nested suites and individual specifications using `describe` and `it` blocks for better structure.
  • When leveraging Jasmine's built-in assertion library via `expect(actual).matcher(expected)` for validating code outcomes.
  • When you require setup and teardown logic for tests using `beforeEach`, `afterEach`, `beforeAll`, and `afterAll` hooks.
  • When you need a testing framework that can run natively in both Node.js and browser environments.
  • When integrating with browser testing tools like Karma, which commonly use Jasmine as its default test framework.
  • When aiming for a zero-dependency testing framework that minimizes external build tool configurations.
WHEN NOT TO USE
  • If your project exclusively requires simple assertion checks without the need for BDD-style describe/it blocks, a lighter assertion library might suffice.
  • If you are building highly performance-critical unit tests where even minimal framework overhead is a concern, consider custom assertion functions.
  • If you prefer a testing framework that strictly adheres to CommonJS or ESM module imports from the outset, Jasmine's global functions may need careful handling or wrappers.
  • When integrating into a project that heavily relies on a different testing ecosystem and introduces potential conflicts with Jasmine's global scope.
  • If you need a framework that automatically handles code coverage reporting as an integrated feature, as Jasmine Core focuses solely on test execution and assertion.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 11
jasmine-core vs playwright ★ 90.4K · 29.2M/wk jasmine-core vs @testing-library/react ★ 19.6K · 21.3M/wk jasmine-core vs chai ★ 8.3K · 38.8M/wk jasmine-core vs cypress ★ 49.7K · 3.4M/wk jasmine-core vs nightwatch ★ 11.9K · 56.7K/wk jasmine-core vs ava ★ 20.9K · 288.3K/wk jasmine-core vs vitest ★ 16.6K · 33.1M/wk jasmine-core vs mocha ★ 22.9K · 6.7M/wk jasmine-core vs jest ★ 45.4K · 21.7M/wk jasmine-core vs fast-check ★ 5.0K · 11.2M/wk jasmine-core vs selenium-webdriver ★ 34.2K · 933.9K/wk