You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

jest-jasmine2

Package Overview
Dependencies
Maintainers
3
Versions
308
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jest-jasmine2


Version published
Maintainers
3
Install size
18.3 MB
Created

Package description

What is jest-jasmine2?

The jest-jasmine2 package is a test runner for Jest that uses Jasmine 2 as its underlying test framework. It allows you to write and run tests using Jasmine's syntax and features within the Jest testing environment.

What are jest-jasmine2's main functionalities?

Basic Test Suite

This feature allows you to define a basic test suite using Jasmine's `describe` and `it` functions. The code sample demonstrates a simple test that always passes.

describe('Basic Test Suite', () => {
  it('should pass a basic test', () => {
    expect(true).toBe(true);
  });
});

Setup and Teardown

This feature allows you to run setup and teardown code before and after each test using `beforeEach` and `afterEach` functions. The code sample demonstrates how to use these functions.

describe('Setup and Teardown', () => {
  beforeEach(() => {
    // Code to run before each test
  });

  afterEach(() => {
    // Code to run after each test
  });

  it('should run setup and teardown', () => {
    expect(true).toBe(true);
  });
});

Matchers

This feature allows you to use various matchers to assert conditions in your tests. The code sample demonstrates the use of `toBe`, `toContain`, and `toEqual` matchers.

describe('Matchers', () => {
  it('should use matchers', () => {
    expect(1 + 1).toBe(2);
    expect([1, 2, 3]).toContain(2);
    expect({a: 1, b: 2}).toEqual({a: 1, b: 2});
  });
});

Other packages similar to jest-jasmine2

Changelog

Source

29.7.0

Features

  • [create-jest] Add npm init / yarn create initialiser for Jest projects (#14465)
  • [jest-validate] Allow deprecation warnings for unknown options (#14499)

Fixes

  • [jest-resolver] Replace unmatched capture groups in moduleNameMapper with empty string instead of undefined (#14507)
  • [jest-snapshot] Allow for strings as well as template literals in inline snapshots (#14465)
  • [@jest/test-sequencer] Calculate test runtime if perStats.duration is missing (#14473)

Performance

  • [@jest/create-cache-key-function] Cache access of NODE_ENV and BABEL_ENV (#14455)

Chore & Maintenance

  • [jest-cli] Move internal config initialisation logic to the create-jest package (#14465)

FAQs

Package last updated on 12 Sep 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc