Skip to content

Commit e6f4e26

Browse files
chore: cleanup and updates (#596)
1 parent 85f44ef commit e6f4e26

30 files changed

Lines changed: 200 additions & 540 deletions

‎.all-contributorsrc‎

Lines changed: 54 additions & 192 deletions
Large diffs are not rendered by default.

‎.devcontainer/devcontainer.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// For format details, see https://aka.ms/devcontainer.json.
22
{
33
"name": "angular-testing-library",
4-
"image": "mcr.microsoft.com/devcontainers/typescript-node:22-bullseye",
4+
"image": "mcr.microsoft.com/devcontainers/typescript-node:24-bookworm",
55

66
// Features to add to the dev container. More info: https://containers.dev/features.
77
"features": {

‎.gitignore‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,4 @@ yarn.lock
4242
# System Files
4343
.DS_Store
4444
Thumbs.db
45-
.cursor/rules/nx-rules.mdc
46-
.github/instructions/nx.instructions.md
4745
.history

‎.nxignore‎

Lines changed: 0 additions & 1 deletion
This file was deleted.

‎README.md‎

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ practices.</p>
5555
- [Table of Contents](#table-of-contents)
5656
- [The problem](#the-problem)
5757
- [This solution](#this-solution)
58+
- [Zoneless support](#zoneless-support)
5859
- [Example](#example)
5960
- [Installation](#installation)
6061
- [Version compatibility](#version-compatibility)
@@ -92,6 +93,20 @@ primary guiding principle is:
9293
> [The more your tests resemble the way your software is used, the more
9394
> confidence they can give you.][guiding-principle]
9495
96+
## Zoneless support
97+
98+
For zoneless applications, Angular Testing Library provides a dedicated slim entry point:
99+
100+
```ts
101+
import { render } from '@testing-library/angular/zoneless';
102+
```
103+
104+
A schematic is available to migrate existing tests:
105+
106+
```bash
107+
ng generate @testing-library/angular:migrate-to-zoneless
108+
```
109+
95110
## Example
96111

97112
counter.component.ts

‎angular.json‎

Lines changed: 5 additions & 129 deletions
Original file line numberDiff line numberDiff line change
@@ -61,53 +61,17 @@
6161
"sourceRoot": "apps/example-app/src",
6262
"prefix": "app",
6363
"architect": {
64-
"build": {
64+
"test-build": {
6565
"builder": "@angular/build:application",
6666
"options": {
67-
"outputPath": {
68-
"base": "dist/apps/example-app"
69-
},
70-
"index": "apps/example-app/src/index.html",
71-
"tsConfig": "apps/example-app/tsconfig.app.json",
72-
"assets": ["apps/example-app/src/favicon.ico", "apps/example-app/src/assets"],
73-
"styles": [],
74-
"scripts": [],
75-
"browser": "apps/example-app/src/main.ts"
76-
},
77-
"configurations": {
78-
"production": {
79-
"budgets": [
80-
{
81-
"type": "anyComponentStyle",
82-
"maximumWarning": "6kb"
83-
}
84-
],
85-
"outputHashing": "all"
86-
},
87-
"development": {
88-
"optimization": false,
89-
"extractLicenses": false,
90-
"sourceMap": true,
91-
"namedChunks": true
92-
}
93-
},
94-
"defaultConfiguration": "production"
95-
},
96-
"serve": {
97-
"builder": "@angular/build:dev-server",
98-
"configurations": {
99-
"production": {
100-
"buildTarget": "example-app:build:production"
101-
},
102-
"development": {
103-
"buildTarget": "example-app:build:development"
104-
}
105-
},
106-
"defaultConfiguration": "development"
67+
"polyfills": [],
68+
"tsConfig": "apps/example-app/tsconfig.spec.json"
69+
}
10770
},
10871
"test": {
10972
"builder": "@angular/build:unit-test",
11073
"options": {
74+
"buildTarget": "example-app:test-build",
11175
"setupFiles": ["apps/example-app/test-setup.ts"]
11276
}
11377
},
@@ -125,50 +89,6 @@
12589
"sourceRoot": "apps/example-app-jest/src",
12690
"prefix": "app",
12791
"architect": {
128-
"build": {
129-
"builder": "@angular/build:application",
130-
"options": {
131-
"outputPath": {
132-
"base": "dist/apps/example-app-jest"
133-
},
134-
"index": "apps/example-app-jest/src/index.html",
135-
"tsConfig": "apps/example-app-jest/tsconfig.app.json",
136-
"assets": ["apps/example-app-jest/src/favicon.ico", "apps/example-app-jest/src/assets"],
137-
"styles": [],
138-
"scripts": [],
139-
"browser": "apps/example-app-jest/src/main.ts"
140-
},
141-
"configurations": {
142-
"production": {
143-
"budgets": [
144-
{
145-
"type": "anyComponentStyle",
146-
"maximumWarning": "6kb"
147-
}
148-
],
149-
"outputHashing": "all"
150-
},
151-
"development": {
152-
"optimization": false,
153-
"extractLicenses": false,
154-
"sourceMap": true,
155-
"namedChunks": true
156-
}
157-
},
158-
"defaultConfiguration": "production"
159-
},
160-
"serve": {
161-
"builder": "@angular/build:dev-server",
162-
"configurations": {
163-
"production": {
164-
"buildTarget": "example-app-jest:build:production"
165-
},
166-
"development": {
167-
"buildTarget": "example-app-jest:build:development"
168-
}
169-
},
170-
"defaultConfiguration": "development"
171-
},
17292
"test": {
17393
"builder": "@angular-builders/jest:run",
17494
"options": {
@@ -189,50 +109,6 @@
189109
"sourceRoot": "apps/example-app-karma/src",
190110
"prefix": "app",
191111
"architect": {
192-
"build": {
193-
"builder": "@angular/build:application",
194-
"options": {
195-
"outputPath": {
196-
"base": "dist/apps/example-app-karma"
197-
},
198-
"index": "apps/example-app-karma/src/index.html",
199-
"tsConfig": "apps/example-app-karma/tsconfig.app.json",
200-
"assets": ["apps/example-app-karma/src/favicon.ico", "apps/example-app-karma/src/assets"],
201-
"styles": [],
202-
"scripts": [],
203-
"browser": "apps/example-app-karma/src/main.ts"
204-
},
205-
"configurations": {
206-
"production": {
207-
"budgets": [
208-
{
209-
"type": "anyComponentStyle",
210-
"maximumWarning": "6kb"
211-
}
212-
],
213-
"outputHashing": "all"
214-
},
215-
"development": {
216-
"optimization": false,
217-
"extractLicenses": false,
218-
"sourceMap": true,
219-
"namedChunks": true
220-
}
221-
},
222-
"defaultConfiguration": "production"
223-
},
224-
"serve": {
225-
"builder": "@angular/build:dev-server",
226-
"configurations": {
227-
"production": {
228-
"buildTarget": "example-app-karma:build:production"
229-
},
230-
"development": {
231-
"buildTarget": "example-app-karma:build:development"
232-
}
233-
},
234-
"defaultConfiguration": "development"
235-
},
236112
"test": {
237113
"builder": "@angular/build:karma",
238114
"options": {

‎apps/example-app-jest/eslint.config.cjs‎

Lines changed: 0 additions & 7 deletions
This file was deleted.

‎apps/example-app-jest/src/app/examples/21-deferable-view.component.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,13 @@ export class DeferableViewChildComponent {}
1010
@Component({
1111
template: `
1212
@defer (on timer(2s)) {
13-
<atl-deferable-view-child />
13+
<atl-deferable-view-child />
1414
} @placeholder {
15-
<p>Hello from placeholder</p>
15+
<p>Hello from placeholder</p>
1616
} @loading {
17-
<p>Hello from loading</p>
17+
<p>Hello from loading</p>
1818
} @error {
19-
<p>Hello from error</p>
19+
<p>Hello from error</p>
2020
}
2121
`,
2222
imports: [DeferableViewChildComponent],

‎apps/example-app-jest/tsconfig.app.json‎

Lines changed: 0 additions & 21 deletions
This file was deleted.

‎apps/example-app-jest/tsconfig.json‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,6 @@
1515
"strictTemplates": true
1616
},
1717
"references": [
18-
{
19-
"path": "./tsconfig.app.json"
20-
},
2118
{
2219
"path": "./tsconfig.spec.json"
2320
}

0 commit comments

Comments
 (0)