Skip to content

Commit e9929a4

Browse files
committed
Fix private method access issue in AnimationEffect for transpiled environments
1 parent 2e6a3c5 commit e9929a4

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "jsdom-testing-mocks",
3-
"version": "1.15.0",
3+
"version": "1.15.1",
44
"author": "Ivan Galiatin",
55
"license": "MIT",
66
"description": "A set of tools for emulating browser behavior in jsdom environment",

src/mocks/web-animations-api/AnimationEffect.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,9 @@ class MockedAnimationEffect implements AnimationEffect {
1818
}
1919
}
2020

21-
#getNormalizedDuration(): number {
21+
// Changed from private (#getNormalizedDuration) to protected (_getNormalizedDuration)
22+
// to allow access from child classes in all JavaScript environments
23+
protected _getNormalizedDuration(): number {
2224
// the only possible value is "auto"
2325
if (typeof this.#timing.duration === 'string') {
2426
return 0;
@@ -34,7 +36,7 @@ class MockedAnimationEffect implements AnimationEffect {
3436

3537
getComputedTiming(): ComputedEffectTiming {
3638
// duration of the animation
37-
const duration = this.#getNormalizedDuration();
39+
const duration = this._getNormalizedDuration();
3840

3941
// Calculated as (iteration_duration * iteration_count)
4042
const activeDuration =

0 commit comments

Comments
 (0)