Repository navigation
refactor(core): add configurable behavior for animations to testbed - #62764
thePunderWoman wants to merge 1 commit into
Conversation
| {provide: Compiler, useFactory: () => new R3TestCompiler(this)}, | ||
| {provide: DEFER_BLOCK_CONFIG, useValue: {behavior: this.deferBlockBehavior}}, | ||
| { | ||
| provide: ANIMATIONS_DISABLED, |
There was a problem hiding this comment.
Would it make sense to expose this token to users, instead of exposing new options on TestBed?
There was a problem hiding this comment.
So I originally had this token exposed as public api, but before landing the feat commit, I was asked to remove it from public api in favor of this approach. I'm sure @AndrewKushnir could provide more thoughts.
There was a problem hiding this comment.
The idea was to put the configuration into the testing context. Originally, the token was exposed via @angular/core, we could've expose it via @angular/core/testing, but in this case having a TestBed config looks more consistent (we had a similar config for defer block behavior).
There was a problem hiding this comment.
The added benefit here is that testbed defaults to animations disabled. So by default they'd only have to provide a configuration if they actually did want to test animations running.
| {provide: Compiler, useFactory: () => new R3TestCompiler(this)}, | ||
| {provide: DEFER_BLOCK_CONFIG, useValue: {behavior: this.deferBlockBehavior}}, | ||
| { | ||
| provide: ANIMATIONS_DISABLED, |
There was a problem hiding this comment.
The idea was to put the configuration into the testing context. Originally, the token was exposed via @angular/core, we could've expose it via @angular/core/testing, but in this case having a TestBed config looks more consistent (we had a similar config for defer block behavior).
9b484d1 to
8c5ef47
Compare
This adds a test module configuration to define whether animations should be enabled or disabled in test. By default, they are disabled.
8c5ef47 to
1f945ec
Compare
AndrewKushnir
left a comment
There was a problem hiding this comment.
Thanks for addressing the feedback 👍
AndrewKushnir
left a comment
There was a problem hiding this comment.
Reviewed-for: public-api
|
This PR was merged into the repository by commit 898244a. The changes were merged into the following branches: main |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This adds a test module configuration to define whether animations should be enabled or disabled in test. By default, they are disabled.
Does this PR introduce a breaking change?