Skip to content

Commit 79ea18b

Browse files
committedNov 18, 2024·
docs: simplify README.md about installation and configuration
1 parent f15ac6a commit 79ea18b

File tree

1 file changed

+2
-52
lines changed

1 file changed

+2
-52
lines changed
 

‎README.md

+2-52
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,7 @@
1212
1313
> This is a part of the article: [Testing Angular faster with Jest](https://www.xfive.co/blog/testing-angular-faster-jest/).
1414
15-
## Getting Started
16-
17-
These instructions will get you setup to use `jest-preset-angular` in your project. For more detailed documentation,
18-
please check [online documentation](https://thymikee.github.io/jest-preset-angular).
15+
## Installation
1916

2017
Install using [`yarn`](https://yarnpkg.com/en/package/jest-preset-angular):
2118

@@ -31,54 +28,7 @@ npm install -D jest jest-preset-angular @types/jest
3128

3229
## Configuration
3330

34-
In your project root, create `setup-jest.ts` file with following contents:
35-
36-
```ts
37-
// setup-jest.ts
38-
import { setupZoneTestEnv } from 'jest-preset-angular/setup-env/zone';
39-
40-
setupZoneTestEnv();
41-
```
42-
43-
Add the following section:
44-
45-
- to your root `jest.config.ts`
46-
47-
```ts
48-
// jest.config.ts
49-
import type { Config } from 'jest';
50-
51-
const jestConfig: Config = {
52-
preset: 'jest-preset-angular',
53-
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
54-
};
55-
56-
export default jestConfig;
57-
```
58-
59-
- or to your root `package.json`
60-
61-
```json
62-
{
63-
"jest": {
64-
"preset": "jest-preset-angular",
65-
"setupFilesAfterEnv": ["<rootDir>/setup-jest.ts"]
66-
}
67-
}
68-
```
69-
70-
Adjust your `tsconfig.spec.json` to be:
71-
72-
```json
73-
{
74-
"extends": "./tsconfig.json",
75-
"compilerOptions": {
76-
"module": "CommonJS",
77-
"types": ["jest"]
78-
},
79-
"include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
80-
}
81-
```
31+
Check out our [Configuration guidance](https://thymikee.github.io/jest-preset-angular/docs/getting-started/installation).
8232

8333
**IMPORTANT**
8434

0 commit comments

Comments
 (0)
Please sign in to comment.