# @ggascoigne/jest-config

> A shareable jest configuration for projects.

Latest version **1.8.0** (published 2025-10-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ggascoigne/jest-config
pnpm add @ggascoigne/jest-config
yarn add @ggascoigne/jest-config
bun add @ggascoigne/jest-config
```

## Health

**Score 35/100 (D)** — status: stable.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: stale.

## Facts

| | |
|---|---|
| Version | 1.8.0 |
| Published | 2025-10-19 |
| First published | 2022-11-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 4.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Guy Gascoigne-Piggford |
| Maintainers | ggascoigne |
| Keywords | jest, jest-config |

## Links

- npm: https://www.npmjs.com/package/@ggascoigne/jest-config
- Repository: https://github.com/ggascoigne/shareable-configs
- Homepage: https://github.com/ggascoigne/shareable-configs/tree/main/packages/jest-config#readme
- Issues: https://github.com/ggascoigne/shareable-configs/issues
- npm.io page: https://npm.io/package/@ggascoigne/jest-config

## Dependencies (4)

- [ts-jest](https://npm.io/package/ts-jest.md) ^29.4.5
- [@types/jest](https://npm.io/package/@types/jest.md) ^29.5.13
- [jest-transform-stub](https://npm.io/package/jest-transform-stub.md) ^2.0.0
- [jest-environment-jsdom](https://npm.io/package/jest-environment-jsdom.md) ^29.7.0

## Alternatives

- [jsforce](https://npm.io/package/jsforce.md) — 851.2K weekly downloads
- [react-native-qrcode-svg](https://npm.io/package/react-native-qrcode-svg.md) — 693.5K weekly downloads
- [@salesforce/plugin-data](https://npm.io/package/@salesforce/plugin-data.md) — 394.9K weekly downloads
- [@backstage/plugin-search-common](https://npm.io/package/@backstage/plugin-search-common.md) — 308.5K weekly downloads
- [@chain-registry/types](https://npm.io/package/@chain-registry/types.md) — 38.4K weekly downloads

## Recent versions

- 1.8.0 (latest) — 2025-10-19
- 1.7.0 — 2024-10-23
- 1.6.5 — 2023-12-18
- 1.6.4 — 2023-11-12
- 1.6.3 — 2023-10-01
- 1.6.2 — 2023-09-09
- 1.6.1 — 2022-12-26
- 1.6.0 — 2022-11-14
- 1.5.0 — 2022-11-14
- 1.4.0 — 2022-11-13

## README

# Jest Config

My personal shareable jest configuration.

## Install

```bash
pnpm add -D jest @ggascoigne/jest-config
```

## Usage

**`jest.config.js`**

```js
module.exports = {
  preset: '@ggascoigne/jest-config',
};
```

## Extending

An example with `testMatch` that Jest uses to detect test files.

**`jest.config.js`**

```js
module.exports = {
  preset: '@ggascoigne/jest-config',
  testMatch: [
    '<rootDir>/__tests__/**/**.+(ts|tsx|js|jsx)',
    '<rootDir>/src/**/?(*.)+(spec|test).+(ts|tsx|js|jsx)',
  ],
};
```

## Add an NPM Script

Running this command:

```bash
npm set-script test "jest"
```

Will create:

**`package.json`**

```json
"scripts": {
  "test": "jest"
},
```

## Add a Pre-commit Hook

**Note**: Executes tests and coverage output related to files that have been changed in the current commit only.

**`lint-staged.config.js`**

```js
module.exports = {
  '*.{js,jsx,ts,tsx}': [
    'pnpm test --bail --passWithNoTests --findRelatedTests --coverage',
  ],
};
```

## Under The Hood

### `jest-preset.js`

- `@types/jest`
- `ts-jest`
- `jest-environment-jsdom`
- `jest-transform-stub`

## License

MIT

---
_Source: https://npm.io/package/@ggascoigne/jest-config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
