Skip to content

Commit

Permalink
undefined options, fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Feb 6, 2021
1 parent 73a0b54 commit fe13dd1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/core/core.datasetController.js
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,8 @@ export default class DatasetController {
options = config.createResolver(scopes, context);
}
const animations = new Animations(chart, options && options[mode] || options);
if (options._cacheable) {
cache[cacheKey] = animations && Object.freeze(animations);
if (options && options._cacheable) {
cache[cacheKey] = Object.freeze(animations);
}
return animations;
}
Expand Down
2 changes: 1 addition & 1 deletion test/specs/core.animations.tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ describe('Chart.animations', function() {
}
});
expect(anims._properties.get('property1')).toEqual(jasmine.objectContaining({duration: 1000}));
expect(anims._properties.get('property2')).toEqual({duration: 2000});
expect(anims._properties.get('property2')).toEqual(jasmine.objectContaining({duration: 2000}));
});

it('should ignore duplicate definitions from collections', function() {
Expand Down

0 comments on commit fe13dd1

Please sign in to comment.