mirror of
https://github.com/chartjs/Chart.js.git
synced 2024-10-06 20:29:12 +02:00
c216c0af76
`karma.conf.ci.js` has been merged into `karma.conf.js` for local testing consistency: `gulp unittestWatch` has been replaced by `gulp unittest --watch` and thus use exactly the same config file. Upgrade to latest jasmine and karma packages and remove deprecated `gulp-karma` dependency (directly use `karma.Server` in gulp). Split `test/mockContext.js` into smaller `test/jasmine.*` modules to make easier unit tests maintenance and finally, move all `*.test.js` files under the `test/specs` folder.
30 lines
735 B
JavaScript
30 lines
735 B
JavaScript
// Tests of the scale service
|
|
describe('Test the scale service', function() {
|
|
|
|
it('should update scale defaults', function() {
|
|
var defaults = {
|
|
testProp: true
|
|
};
|
|
var type = 'my_test_type';
|
|
var Constructor = function() {
|
|
this.initialized = true;
|
|
};
|
|
Chart.scaleService.registerScaleType(type, Constructor, defaults);
|
|
|
|
// Should equal defaults but not be an identical object
|
|
expect(Chart.scaleService.getScaleDefaults(type)).toEqual(jasmine.objectContaining({
|
|
testProp: true
|
|
}));
|
|
|
|
Chart.scaleService.updateScaleDefaults(type, {
|
|
testProp: 'red',
|
|
newProp: 42
|
|
});
|
|
|
|
expect(Chart.scaleService.getScaleDefaults(type)).toEqual(jasmine.objectContaining({
|
|
testProp: 'red',
|
|
newProp: 42
|
|
}));
|
|
});
|
|
});
|