Socket
Socket
Sign inDemoInstall

@types/jest

Package Overview
Dependencies
43
Maintainers
1
Versions
207
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/jest

TypeScript definitions for jest


Version published
Maintainers
1
Weekly downloads
16,686,076
decreased by-26.48%

Weekly downloads

Package description

What is @types/jest?

The @types/jest package provides TypeScript type definitions for Jest, a popular JavaScript testing framework. This allows developers to use Jest in TypeScript projects with type checking and IntelliSense support for Jest's API.

What are @types/jest's main functionalities?

Type Definitions for Jest Functions

Provides type definitions for Jest's global functions like 'test' and 'expect', enabling type checking and autocompletion in TypeScript.

test('adds 1 + 2 to equal 3', () => {
  expect(1 + 2).toBe(3);
});

Type Definitions for Matchers

Includes type definitions for Jest's matchers, such as 'toMatch', 'toBe', and 'toHaveProperty', ensuring correct usage with TypeScript.

expect('hello').toMatch(/hello/);

Type Definitions for Mock Functions

Provides type definitions for Jest's mock functions and their methods like 'mockReturnValue' and 'mockImplementation'.

const mockFunction = jest.fn();
mockFunction.mockReturnValue('default value');

Type Definitions for Jest Configuration

Offers type definitions for Jest configuration options, which can be used when setting up Jest in a TypeScript project.

const jestConfig = {
  verbose: true,
  collectCoverage: true
};

Other packages similar to @types/jest

Readme

Source

Installation

npm install --save @types/jest

Summary

This package contains type definitions for jest (https://jestjs.io/).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/jest.

Additional Details

  • Last updated: Thu, 01 Feb 2024 17:07:05 GMT
  • Dependencies: expect, pretty-format

Credits

These definitions were written by Asana (https://asana.com) // Ivo Stratev, jwbay, Alexey Svetliakov, Alex Jover Morales, Allan Lukwago, Ika, Waseem Dahman, Jamie Mason, Douglas Duteil, Ahn, Jeff Lau, Andrew Makarov, Martin Hochel, Sebastian Sebald, Andy, Antoine Brault, Gregor Stamać, ExE Boss, Alex Bolenok, Mario Beltrán Alarcón, Tony Hallett, Jason Yu, Pawel Fajfer, Alexandre Germain, Adam Jones, and Tom Mrazauskas.

FAQs

Last updated on 01 Feb 2024

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc