Skip to content

Conversation

timdeschryver
Copy link
Member

No description provided.

@timdeschryver timdeschryver merged commit 975bafa into beta Aug 7, 2025
6 checks passed
@timdeschryver timdeschryver deleted the remove-zoneless-render branch August 7, 2025 15:13
@markgoho
Copy link
Contributor

@timdeschryver what was the thinking here? Does this not have an impact on testing?

@timdeschryver
Copy link
Member Author

@markgoho Angular has a built-in solution to register providers at a global level, which will be provided in each testbed.
See https://github.com/timdeschryver/Sandbox/blob/main/Sandbox.AngularWorkspace/projects/sandbox-app/src/test-providers.ts for an example.
This can be used for full zone-less applications.

I prefer using built-in Angular functionality over providing another way in ATL.

For one-off components (I don't know if this happens?), it's still possible to add the provideZonelessChangeDetection provider manually using the providers array.

https://x.com/tim_deschryver/status/1951350693450666360

@markgoho
Copy link
Contributor

markgoho commented Sep 18, 2025

oh for sure, native > custom any day!

so we're just now getting our big monorepo onto Angular 20, haven't started to use zoneless, and haven't migrated to ATL v18 (also haven't tried vitest), but I think what you're showing here with the Sandbox app is:

test-providers.ts to export providers common to all testing setups

and then something like this as the mechanism to include them (may be slightly different for Jest-based testing)

"providersFile": "projects/sandbox-app/src/test-providers.ts"

so, if the App is zoneless, you do have to make sure that provider exists in all tests, it's just that Angular has a native way to do this, and it won't fall to ATL to expose a way to do it

@timdeschryver
Copy link
Member Author

@markgoho Correct! I think the new providersFile option works for all test runners but I'm not 100% sure of it.

so, if the App is zoneless, you do have to make sure that provider exists in all tests, it's just that Angular has a native way to do this, and it won't fall to ATL to expose a way to do it

It's either this, or you have to manually add the zoneless option to each test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants