Skip to content

Commit

Permalink
test(): Convert Animation tests to jest (#9892)
Browse files Browse the repository at this point in the history
  • Loading branch information
asturur committed May 27, 2024
1 parent 9e48de1 commit e7a0080
Show file tree
Hide file tree
Showing 6 changed files with 3,262 additions and 931 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## [next]

- test(): Convert Animation tests to jest [#9892](https://github.com/fabricjs/fabric.js/pull/9892)
- perf(ObjectGeometry): replace cache key string with array [#9887](https://github.com/fabricjs/fabric.js/pull/9887)
- docs(): Improve JSDOCs for BlendImage [#9876](https://github.com/fabricjs/fabric.js/pull/9876)
- fix(Group): Pass down the abort signal from group to objects [#9890](https://github.com/fabricjs/fabric.js/pull/9890)
Expand Down
2 changes: 1 addition & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ module.exports = {
// globals: {},

// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
// maxWorkers: "50%",
maxWorkers: '75%',

// An array of directory names to be searched recursively up from the requiring module's location
// moduleDirectories: [
Expand Down
6 changes: 2 additions & 4 deletions src/shapes/Object/AnimatableObject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,14 @@ export abstract class AnimatableObject<
const propIsColor = (
this.constructor as typeof AnimatableObject
).colorProperties.includes(path[path.length - 1]);
const { easing, duration, abort, startValue, onChange, onComplete } =
options;
const { abort, startValue, onChange, onComplete } = options;
const animationOptions = {
...options,
target: this,
// path.reduce... is the current value in case start value isn't provided
startValue:
startValue ?? path.reduce((deep: any, key) => deep[key], this),
endValue,
easing,
duration,
abort: abort?.bind(this),
onChange: (
value: number | number[] | string,
Expand Down
Loading

0 comments on commit e7a0080

Please sign in to comment.