Socket
Socket
Sign inDemoInstall

@jest/types

Package Overview
Dependencies
13
Maintainers
7
Versions
94
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @jest/types


Version published
Weekly downloads
70M
decreased by-0.38%
Maintainers
7
Install size
926 kB
Created
Weekly downloads
 

Package description

What is @jest/types?

The @jest/types package provides TypeScript definitions and utility types for Jest, a popular JavaScript testing framework. It includes types for Jest configuration, global variables, and other utilities that help in creating type-safe test environments and extending Jest functionalities.

What are @jest/types's main functionalities?

Config

Defines types for Jest configuration options. This allows for type-safe Jest configuration files, ensuring that any configuration options passed to Jest are valid.

{"globals": {"myGlobal": "value"}, "testMatch": ["**/__tests__/**/*.js?(x)", "**/?(*.)+(spec|test).js?(x)"]}

Global

Provides types for Jest's global variables and functions, such as 'describe', 'it', and 'expect'. This is useful for creating custom global setups or mocks in a type-safe manner.

"declare var jest: jest.Jest"

Mock

Includes types for Jest's mocking utilities, enabling developers to create and manipulate mocks with full TypeScript support.

"const mockedFunction: jest.Mock = jest.fn()"

Other packages similar to @jest/types

Changelog

Source

26.6.2

Features

  • [jest-core] Add findRelatedTests and nonFlagArgs in allowed config options for updateConfigAndRun in watch plugins (#10659)

Fixes

  • [babel-plugin-jest-hoist] Preserve order of hoisted mock nodes within containing block (#10536)
  • [babel-plugin-jest-hoist] Hoist pure constants to support experimental JSX transform in hoisted mocks (#10723)
  • [babel-preset-jest] Update babel-preset-current-node-syntax to support top level await (#10747)
  • [expect] Revert "Fix objectContaining to work recursively into sub-objects (#10508)" (#10766)
  • [jest-circus, jest-jasmine2] fix: don't assume stack is always a string (#10697)
  • [jest-config] Fix bug introduced in watch mode by PR #10678 (#10692)
  • [jest-config] Throw correct error for missing preset modules (#10737)
  • [jest-resolve-dependencies] Resolve mocks as dependencies (#10713)
  • [jest-runtime] Handle file URLs in dynamic imports (#10744)
  • [jest-runtime, babel-jest] Pass more ESM options to @jest/transform (#10752)
  • [jest-runtime] Properly inject extraGlobals into the runtime (#10758)
  • [jest-transform] Link to ESM docs on syntax errors (#10748)

Chore & Maintenance

  • [docs] Add docs for using mocks in TypeScript (#10415)
  • [eslint-config-fb-strict] Move package from this repo to fbjs repo (#10739)
  • [examples] Update TypeScript example to show use of newer Jest types (#10399)
  • [jest-cli] chore: standardize files and folder names (#10698)
  • [jest-config] Switch ts-node Register type to Service due to deprecation (#11210)

FAQs

Last updated on 02 Nov 2020

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