Packages

babel-jest

30.5.2 · 18 Sep 2026MIT71.6M / weekRepositoryHomepagenpmAtom feed

Your version

25.1.0

22 Jan 2020Where it was published

25.5.1 is the newest release of 25.x.

In short

19 breaking33 new28 fixed9 internal

  • breaking

    jest-config: Set default display name color based on runner

  • breaking

    jest-config: Support .mjs config files

  • breaking

    jest-diff: Export as ECMAScript module

  • breaking

    jest-runtime: Do not export ScriptTransformer - it can be imported from @jest/transform instead

  • breaking

    jest-snapshot: Improve report when the matcher has properties

  • breaking

    jest-transform: Return transformed code as a string, do not wrap in vm.Script

  • breaking

    jest-worker: Return a promise from end(), resolving with the information whether workers exited gracefully

  • breaking

    expect: Consider primitives different from wrappers instantiated with new

Release note

Features

  • babel-plugin-jest-hoist: Show codeframe on static hoisting issues

  • babel-plugin-jest-hoist: Add BigInt to ALLOWED_IDENTIFIERS

  • babel-preset-jest: Add @babel/plugin-syntax-bigint

  • expect: Add BigInt support to toBeGreaterThan, toBeGreaterThanOrEqual, toBeLessThan and toBeLessThanOrEqual

  • expect, jest-matcher-utils: Display change counts in annotation lines

  • expect, jest-snapshot: Support custom inline snapshot matchers

  • jest-config: Throw the full error message and stack when a Jest preset is missing a dependency

  • breaking

    jest-config: Set default display name color based on runner

  • jest-config: Merge preset globals with project globals

  • jest-config: Support .cjs config files

  • breaking

    jest-config: Support .mjs config files

  • jest-core: Support reporters as default exports

  • jest-core: Support --findRelatedTests paths case insensitivity on Windows

  • jest-diff: Add options for colors and symbols

  • breaking

    jest-diff: Export as ECMAScript module

  • jest-diff: Add includeChangeCounts and rename Indicator options

  • jest-diff: Add changeColor and patchColor options

  • jest-diff: Add trailingSpaceFormatter option and replace cyan with commonColor

  • jest-diff: Add firstOrLastEmptyLineReplacement option and export 3 diffLines functions

  • jest-environment: Add optional getVmContext next to runScript (#9252 & #9428)

  • jest-environment-jsdom: Add fakeTimersLolex

  • jest-environment-node: Add fakeTimersLolex

  • jest-environment-node: Add queueMicrotask

  • jest-environment-node: Implement getVmContext (#9252 & #9428)

  • @jest/fake-timers: Add Lolex as implementation of fake timers

  • jest-get-type: Add BigInt support.

  • jest-matcher-utils: Add BigInt support to ensureNumbers ensureActualIsNumber, ensureExpectedIsNumber

  • jest-matcher-utils: Ignore highlighting matched asymmetricMatcher in diffs

  • jest-reporters: Export utils for path formatting

  • jest-reporters: Provides global coverage thresholds as watermarks for istanbul

  • jest-runner: Warn if a worker had to be force exited

  • breaking

    jest-runtime: Do not export ScriptTransformer - it can be imported from @jest/transform instead

  • jest-runtime: Use JestEnvironment.getVmContext and vm.compileFunction if available to avoid the module wrapper (#9252 & #9428)

  • jest-snapshot: Display change counts in annotation lines

  • breaking

    jest-snapshot: Improve report when the matcher has properties

  • jest-snapshot: Improve colors when snapshots are updatable

  • jest-snapshot: Ignore indentation for most serialized objects

  • jest-transform: Create createTranspilingRequire function for easy transpiling modules

  • breaking

    jest-transform: Return transformed code as a string, do not wrap in vm.Script

  • @jest/test-result: Create method to create empty TestResult

  • breaking

    jest-worker: Return a promise from end(), resolving with the information whether workers exited gracefully

  • jest-reporters: Transform file paths into hyperlinks

Fixes

  • expect: Display expectedDiff more carefully in toBeCloseTo

  • expect: Avoid incorrect difference for subset when toMatchObject fails

  • expect: Consider all RegExp flags for equality

  • breaking

    expect: Consider primitives different from wrappers instantiated with new

  • expect: Prevent maintaining RegExp state between multiple tests

  • expect: Fix subsetEquality false circular reference detection

  • jest-config: Use half of the available cores when watchAll mode is enabled

  • jest-config: Fix Jest multi project runner still cannot handle exactly one project

  • jest-console: Add missing console.group calls to NullConsole

  • jest-core: Don't include unref'd timers in --detectOpenHandles results

  • jest-core: Limit number of workers when creating haste maps in projects

  • jest-diff: Do not inverse format if line consists of one change

  • jest-diff: Rename some new options and change their default values

  • jest-environment-node: Fix TextEncoder.encode not referencing same global Uint8Array constructor

  • jest-fake-timers: getTimerCount will not include cancelled immediates

  • jest-fake-timers: Support util.promisify on setTimeout

  • jest-jasmine2, jest-circus: Improve error message format for Node's assert.fail

  • breaking

    jest-leak-detector: Use weak-napi instead of weak package

  • jest-mock: Fix for mockReturnValue overriding mockImplementationOnce

  • jest-reporters: Make node-notifier an optional dependency

  • jest-reporters: Make all arguments to methods on BaseReporter optional

  • : Set MODULE_NOT_FOUND as error code when module is not resolved from paths

  • jest-resolve-dependencies: Handle dynamic dependencies correctly even when using module maps

  • jest-snapshot: Remove only the added newlines in multiline snapshots

  • jest-snapshot: Distinguish empty string from external snapshot not written

  • breaking

    jest-snapshot: Distinguish empty string from internal snapshot not written

  • breaking

    jest-snapshot: Remove report method and throw matcher errors

  • jest-snapshot: Omit irrelevant received properties when property matchers fail

  • jest-transform: Properly cache transformed files across tests

  • jest-transform: Don't fail the test suite when a generated source map is invalid

  • breaking

    jest-types: Use less null | undefined in config types

  • jest-util: Allow querying process.domain

  • pretty-format: Correctly detect memoized elements

  • pretty-format: Fix pretty-format to respect displayName on forwardRef

Chore & Maintenance

  • breaking

    *: Drop support for Node 6

  • breaking

    *: Upgrade to Micromatch v4

  • breaking

    babel-plugin-jest-hoist: Use ESM exports

  • breaking

    jest: Use ESM exports

  • breaking

    jest-cli: Use ESM exports

  • breaking

    jest-cli: Remove re-exports from @jest/core

  • breaking

    jest-environment-jsdom: Upgrade JSDOM from v11 to v15

  • breaking

    jest-reporters: Upgrade Istanbul dependencies, which are used for code coverage

  • breaking

    jest-util: Remove deprecated exports

  • breaking

    jest-validate: Use ESM exports