# jest-preset-angular packages the Jest setup an Angular project needs

> jest-preset-angular is a configuration preset rather than a test framework. It assembles the pieces an Angular project needs to run Jest, from the TypeScript transform through to the Angular testing environment, and it exists because Angular's own build and test tooling did not offer a Jest path out of the box. Its one hard constraint is that Angular does not support native async/await in testing with a target above ES2016.

**thymikee/jest-preset-angular** — Jest configuration preset for Angular projects.

- Repository: https://github.com/thymikee/jest-preset-angular
- Website: https://thymikee.github.io/jest-preset-angular/
- Stars: 917 · Forks: 305
- Language: TypeScript
- License: MIT
- Published: 2026-10-20 · Updated: 2026-10-20 · Language: en
- Canonical page: https://hysenlabs.com/projects/thymikee-jest-preset-angular

## A preset is a bundle of configuration, not a runner

The repository description is one line: Jest configuration preset for Angular projects. Understanding what that means is the whole point.
Jest is the test runner. Angular projects ship with their own runner and their own test environment, and getting Jest to execute Angular tests requires a specific transformer for TypeScript, a specific test environment that boots the Angular platform, and a set of module mappings so that a component import resolves the same way in a test as it does in a build. That configuration is what a preset packages.
The README names the pieces it is built with. TypeScript is listed as JavaScript that scales, Angular as delivering web apps with confidence, and ts-jest as the Jest transformer for TypeScript.
So the preset sits between Jest and Angular. It does not replace Jest and it does not replace Angular's compiler. It makes them work together.
The audience is Angular developers who have decided they want Jest, usually for reasons of speed, a shared runner across a polyglot repository, or a testing setup that does not depend on the browser Karma based default. The repository also points to an article, Testing Angular faster with Jest, that the project is part of, which tells you the intent is performance.
The project is maintained by Michał Pierzchała, with Ahn and Thomas listed as contributors, and the documentation lives at thymikee.github.io/jest-preset-angular/.

## Check the async target for the chosen test environment

The preset's installation guide warns that native `async`/`await` with a TypeScript target above ES2016 can cause problems in Angular testing. Its example uses `setupZoneTestEnv`; Angular explains that ZoneJS cannot effectively patch native `async`/`await`, which is why affected code may need downleveling.

This is not a blanket claim that every Angular test or every preset configuration fails above ES2016. Angular also supports zoneless testing, and current Angular applications can use zoneless change detection. Check the preset documentation and the test environment for the versions in use, then validate the chosen `tsconfig.spec.json` with representative asynchronous tests.

The README also links a migration guide for projects moving from Angular 13 or below. Consult that guide before copying an older Jest configuration.

## Installing it, and the presets the package ships

The README does not print the install command itself and instead points at the Installation guidance page in the online documentation, which is where the current steps live for the version you are installing.
The repository layout shows what the package contains. There is a jest-preset.js file at the root, a presets/ directory, a src/ directory for the transformers, a setup-env/ directory, a jest.config.ts for the project's own tests, and an environments/ directory. The src/transformers/ path is where the interesting code lives, because that is what the build script bundles.
The package.json points main at build/index.js and typings at build/index.d.ts, so the package ships compiled JavaScript plus type declarations, which is the normal arrangement for a preset consumed by Jest's resolver.
The node engine field is explicit.
```json
"engines": {
    "node": "^20.11.1 || >=22.0.0"
  }
```
That is a floor rather than a range with an upper bound, so it accepts Node 20.11.1 and up within the 20 line, and anything from 22 onwards. A project still on Node 18 will not satisfy it.
The package version is 17.0.3, and the npm version badge in the README points at the npmjs.com page for jest-preset-angular.

## Example apps from v20 onwards, including a monorepo

The examples directory is the fastest way to see a working configuration, and the README describes what is in it.
The examples folder consists of several example Angular applications from v13 onwards as well as example projects with yarn workspace or monorepo structure. The current tree holds example-app-v20, example-app-v21, example-app-v22 and example-app-monorepo.
Two things fall out of that list. The version specific apps show the configuration as it changed with each Angular major, which matters because the setup did change at Angular 13 and the migration guide exists precisely because of that. And the monorepo example covers a case that is genuinely different, because in a workspace setup the Jest configuration and the module resolution have to work with the workspace layout rather than with a single project root.
The examples are also exercised in the build. There is a script called test-examples that runs tsx scripts/test-examples.ts, so the example applications are not just documentation, they are part of the test suite.
That is a meaningful quality signal for a preset. A preset whose job is to make another tool work can easily break in a configuration it never tried, and keeping versioned examples under test is how that gets caught.

## esbuild bundles the JIT transformer, and TypeScript compiles the rest

The build is two steps, and the second one is the interesting one.
```json
"build": "tsc -p tsconfig.build.json && yarn build-transformers-bundle",
```
The first command compiles the TypeScript sources with the build tsconfig into the build directory that the package entry points reference.
The second command is a separate script that runs esbuild.
```json
"build-transformers-bundle": "esbuild --bundle --minify --target=es6 src/transformers/jit_transform.d.ts --platform=node --external:typescript --outfile=./src/transformers/jit_transform.js --format=cjs --define:import.meta.url=import_meta_url --inject:./src/transformers/esm_interop_inject.cjs && cp src/transformers/jit_transform.js build/transformers/jit_transform.js",
```
Several choices in that line are deliberate. The target is es6, which lines up with the ES2016 constraint described earlier. The typescript package is marked external, so the transformer does not bundle its own copy of the compiler. The output format is cjs, because Jest loads transformers through CommonJS. The import.meta.url is defined through a define flag, and an esm_interop_inject.cjs file is injected to shim the interop between the ES module sources and the CommonJS output.
The result is then copied into the build directory, so the published artefact contains the bundled transformer.
The other scripts follow the same pattern of small, verifiable steps: lint is eslint ., lint-fix is eslint --fix ., the prettier scripts check and write yml, yaml and md files, and the doc scripts run the website directory with yarn start and yarn build.

## Four ways the project tests itself

The scripts describe a test strategy that is broader than the usual single suite.
```json
"test": "yarn build && jest",
"test-perf": "jest -c=performance/jest.config.ts --no-cache",
"doc": "cd website && yarn start",
```
The default test script builds the package and then runs Jest, and the build step is part of the test because the tests exercise the built artefact rather than the sources.
There is a separate e2e configuration at e2e/jest.config.ts, a separate performance configuration at performance/jest.config.ts that runs with --no-cache so that the timing is not distorted by a warm cache, and the examples runner.
The performance suite is the interesting one for a project whose stated purpose is speed. A preset that claims faster tests should be able to show it, and having a dedicated benchmark configuration in the repository means the claim is at least checked somewhere.
The repository also carries a sonar-project.properties file, which means the project's own code is analysed by Sonar, and a .husky/ directory with commitlint.config.ts, so commits are checked against a conventional commit format and hooks are installed on the client side. The AGENTS.md file at the root is there for AI coding agents, following the same convention used elsewhere in the ecosystem.

## MIT licensed, monthly releases, and an active tree

The licence is MIT, and the README says so in a section pointing at the LICENSE.md file for details.
The project is MIT licensed, which is the easy case for adoption. There is no copyleft obligation and no restriction on commercial use, so a preset can be dropped into a proprietary Angular application without a licence review.
On activity, the repository is not archived and the last push was on 2026-10-19. The releases are v17.0.3 on 2026-10-13, v17.0.2 on 2026-10-05 and v17.0.1 on 2026-09-25, so patch releases are landing every week or two within a major line, and the version number tracks the Angular major it supports.
That last point is the one to remember when you plan an upgrade. A preset pinned to an Angular major is not a floating dependency, and a major version bump in the preset means the Angular version moved, which means the configuration and possibly the compiler target have to move with it.
The rest of the repository layout supports the maintenance story: a .github/ directory, a CHANGELOG.md, a CONTRIBUTING.md, an eslint.config.mjs, a renovate.json for dependency updates, a website/ directory for the documentation site, a .yarn/ directory with a .yarnrc.yml so the project uses Yarn's own release and plugin mechanism, and separate tsconfig files for the base, build, eslint and spec configurations.

## Conclusion

Adopt jest-preset-angular when you want Jest rather than the default Angular test runner in an Angular project and you have already read the installation guidance for the version you are on. Do not adopt it if you are happy with the standard runner, since the preset exists to replace it rather than to improve on it. Before you upgrade, check that your tsconfig target is at or below ES2016, because the README flags that Angular does not support native async and await in testing above that target, and check that your Node version satisfies the engine range in package.json.

## FAQ

### What is jest-preset-angular?

It is a preset of Jest configuration for Angular projects, built with TypeScript, Angular and ts-jest as the Jest transformer for TypeScript. The package ships compiled output at build/index.js with type declarations at build/index.d.ts.

### What is the ES2016 limitation with jest-preset-angular?

The README flags as important that Angular does not support native async/await in testing with a target higher than ES2016. The build of the transformer therefore targets es6, so your test compilation target needs to stay at or below ES2016.

### Which Node versions does jest-preset-angular support?

The engines field in package.json requires node ^20.11.1 || >=22.0.0.

### Does jest-preset-angular work with monorepos?

The README says the examples folder contains several example Angular applications from v13 onwards as well as example projects with yarn workspace or monorepo structure, and the repository includes an example-app-monorepo project.

### How do I migrate a project that uses Angular below 13?

The README links a dedicated migration guide, the Migration from Angular less than 13 guidance page in the online documentation, because the configuration changed materially at that point.

## Sources

- [License: MIT](https://github.com/thymikee/jest-preset-angular/blob/main/LICENSE)
- [Project website](https://thymikee.github.io/jest-preset-angular/)
- [README](https://github.com/thymikee/jest-preset-angular/blob/main/README.md)
- [Releases](https://github.com/thymikee/jest-preset-angular/releases)
- [thymikee/jest-preset-angular on GitHub](https://github.com/thymikee/jest-preset-angular)

---

Hysen Labs editorial analysis, written from the project's own repository and release notes. Cite the canonical page: https://hysenlabs.com/projects/thymikee-jest-preset-angular
