# @angular-ru/jest-utils

> Angular-RU package

Latest version **15.304.1** (published 2021-07-09) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @angular-ru/jest-utils
pnpm add @angular-ru/jest-utils
yarn add @angular-ru/jest-utils
bun add @angular-ru/jest-utils
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 15.304.1 |
| Published | 2021-07-09 |
| First published | 2020-04-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 23.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 73 |
| Author | angular-ru@yandex.ru |
| Maintainers | angular-ru |
| Keywords | angular-ru, angular, sdk |

## Links

- npm: https://www.npmjs.com/package/@angular-ru/jest-utils
- Repository: https://github.com/Angular-RU/angular-ru-sdk
- Homepage: https://github.com/Angular-RU/angular-ru-sdk/tree/master/packages/jest-utils#readme
- Issues: https://github.com/Angular-RU/angular-ru-sdk/issues
- npm.io page: https://npm.io/package/@angular-ru/jest-utils

## Dependencies (4)

- [jest](https://npm.io/package/jest.md) 27.0.6
- [ts-jest](https://npm.io/package/ts-jest.md) 27.0.3
- [@types/jest](https://npm.io/package/@types/jest.md) 26.0.24
- [jest-preset-angular](https://npm.io/package/jest-preset-angular.md) 9.0.4

## Recent versions

- 15.304.1 (latest) — 2021-07-09
- 15.303.0 — 2021-07-09
- 15.301.3 — 2021-07-07
- 15.301.0 — 2021-07-05
- 15.267.0 — 2021-06-22
- 15.253.0 — 2021-06-09
- 15.237.0 — 2021-05-11
- 15.236.0 — 2021-05-11
- 15.231.1 — 2021-05-10
- 15.224.0 — 2021-05-07
- 15.220.0 — 2021-05-06
- 15.209.0 — 2021-04-26
- 15.199.0 — 2021-04-15
- 15.171.0 — 2021-03-26
- 15.159.0 — 2021-03-17
- … 118 more at https://npm.io/package/@angular-ru/jest-utils/versions

## README

# Automatic create Jest config for Angular projects

<p>
  <a href="https://badge.fury.io/js/%40angular-ru%2Fjest-utils">
    <img src="https://badge.fury.io/js/%40angular-ru%2Fjest-utils.svg" />
  </a>
  <a href="https://npm-stat.com/charts.html?package=%40angular-ru%2Fjest-utils&from=2019-09-01">
    <img src="https://img.shields.io/npm/dw/@angular-ru/jest-utils" />
  </a>
</p>

It's very convenient to testing our applications with Angular and Jest now.

### Quick start

```bash
$ npm install @angular-ru/jest-utils -D
```

Create `jest.config.js`

```ts
const { createTsJestConfig } = require('@angular-ru/jest-utils');

module.exports = createTsJestConfig({
    tsConfig: './tsconfig.json',
    jestConfig: {
        rootDir: '.',
        displayName: 'My Angular App',
        testMatch: ['<rootDir>/tests/**/*.spec.ts'],
        collectCoverageFrom: ['<rootDir>/src/app/**/*.ts']
    }
});
```

```bash
$ jest --config jest.config.js --coverage
```

### FAQ

-   I have `jest-haste-map: Haste module naming collision`

```ts
module.exports = createTsJestConfig({
    // ...
    jestConfig: {
        // ...
        modulePathIgnorePatterns: ['<rootDir>/dist/']
    }
});
```

-   How can I add setupFilesAfterEnv files?

```ts
module.exports = createTsJestConfig({
    // ...
    jestConfig: {
        // ...
        setupFilesAfterEnv: ['<rootDir>/setup-jest.ts']
    }
});
```

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