jest/packages/jest-types
Spenser Black 4d573817e2
Allow `testMatch` to take a string value (#15734)
2025-07-14 08:38:22 +09:00
..
__typetests__ chore: upgrade TSTyche (#15596) 2025-05-22 17:05:54 +09:00
src Allow `testMatch` to take a string value (#15734) 2025-07-14 08:38:22 +09:00
.npmignore chore: make sure to exclude .eslintcache from published module (#13832) 2023-01-28 11:57:53 +01:00
README.md chore: use consistent type imports (#14662) 2023-10-30 13:37:25 +01:00
package.json v30.0.1 2025-06-19 07:31:08 +09:00
tsconfig.json Fix testPathPatterns when config is in subdirectory (#14934) 2024-05-29 08:41:13 +02:00

README.md

@jest/types

This package contains shared types of Jest's packages.

If you are looking for types of Jest globals, you can import them from @jest/globals package:

import {describe, expect, it} from '@jest/globals';

describe('my tests', () => {
  it('works', () => {
    expect(1).toBe(1);
  });
});

If you prefer to omit imports, a similar result can be achieved installing the @types/jest package. Note that this is a third party library maintained at DefinitelyTyped and may not cover the latest Jest features.

Another use-case for @types/jest is a typed Jest config as those types are not provided by Jest out of the box:

// jest.config.ts
import type {Config} from '@jest/types';

const config: Config.InitialOptions = {
  // some typed config
};

export default config;