* Fix retina unit test failures
* Honor config file formatting
* Prevent gulp error on non-zero karma result
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
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() {
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;
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);
});
});
});