mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Fix tests on OSX with retina screen
* Fix retina unit test failures * Honor config file formatting * Prevent gulp error on non-zero karma result
This commit is contained in:
parent
9ef5cc72f6
commit
8dca88c7d5
@ -8,3 +8,11 @@ end_of_line = lf
|
||||
charset = utf-8
|
||||
trim_trailing_whitespace = true
|
||||
insert_final_newline = false
|
||||
|
||||
[gulpfile.js]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
[*.yml]
|
||||
indent_style = space
|
||||
indent_size = 2
|
||||
|
||||
@ -188,7 +188,12 @@ function unittestTask(done) {
|
||||
args: {
|
||||
coverage: !!argv.coverage
|
||||
}
|
||||
}, done).start();
|
||||
},
|
||||
// https://github.com/karma-runner/gulp-karma/issues/18
|
||||
function(error) {
|
||||
error = error ? new Error('Karma returned with the error code: ' + error) : undefined;
|
||||
done(error);
|
||||
}).start();
|
||||
}
|
||||
|
||||
function librarySizeTask() {
|
||||
|
||||
@ -22,6 +22,10 @@ var utils = require('./jasmine.utils');
|
||||
return new Context();
|
||||
}
|
||||
|
||||
// force ratio=1 for tests on high-res/retina devices
|
||||
// fixes https://github.com/chartjs/Chart.js/issues/4515
|
||||
window.devicePixelRatio = 1;
|
||||
|
||||
window.acquireChart = acquireChart;
|
||||
window.releaseChart = releaseChart;
|
||||
window.waitForResize = utils.waitForResize;
|
||||
|
||||
@ -394,8 +394,8 @@ describe('Platform.dom', function() {
|
||||
expect(notifiedEvent.type).toBe(evt.type);
|
||||
|
||||
// Relative Position
|
||||
expect(notifiedEvent.x).toBe(chart.width / 2);
|
||||
expect(notifiedEvent.y).toBe(chart.height / 2);
|
||||
expect(notifiedEvent.x).toBeCloseToPixel(chart.width / 2);
|
||||
expect(notifiedEvent.y).toBeCloseToPixel(chart.height / 2);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user