gulp.task('build', buildTask);
gulp.task('package', packageTask);
gulp.task('watch', watchTask);
-gulp.task('lint', ['lint-html', 'lint-js']);
gulp.task('lint-html', lintHtmlTask);
gulp.task('lint-js', lintJsTask);
+gulp.task('lint', gulp.parallel('lint-html', 'lint-js'));
gulp.task('docs', docsTask);
-gulp.task('test', ['lint', 'unittest']);
-gulp.task('size', ['library-size', 'module-sizes']);
gulp.task('server', serverTask);
gulp.task('unittest', unittestTask);
+gulp.task('test', gulp.parallel('lint', 'unittest'));
gulp.task('library-size', librarySizeTask);
gulp.task('module-sizes', moduleSizesTask);
+gulp.task('size', gulp.parallel('library-size', 'module-sizes'));
gulp.task('_open', _openTask);
-gulp.task('dev', ['server', 'default']);
-gulp.task('default', ['build', 'watch']);
+gulp.task('default', gulp.parallel('build', 'watch'));
+gulp.task('dev', gulp.parallel('server', 'default'));
/**
* Generates the bower.json manifest file which will be pushed along release tags.
}
function watchTask() {
- return gulp.watch('./src/**', ['build']);
+ return gulp.watch('./src/**', gulp.parallel('build'));
}
function serverTask() {
"url": "https://github.com/chartjs/Chart.js.git"
},
"devDependencies": {
- "browserify": "^14.5.0",
+ "browserify": "^16.2.3",
"browserify-istanbul": "^3.0.1",
"bundle-collapser": "^1.3.0",
"child-process-promise": "^2.2.1",
"coveralls": "^3.0.0",
- "eslint": "^4.9.0",
+ "eslint": "^5.9.0",
"eslint-config-chartjs": "^0.1.0",
- "eslint-plugin-html": "^4.0.2",
+ "eslint-plugin-html": "^5.0.0",
"gitbook-cli": "^2.3.2",
- "gulp": "3.9.x",
- "gulp-concat": "~2.6.x",
- "gulp-connect": "~5.0.0",
- "gulp-eslint": "^4.0.0",
- "gulp-file": "^0.3.0",
- "gulp-htmllint": "^0.0.15",
- "gulp-insert": "~0.5.0",
- "gulp-replace": "^0.6.1",
- "gulp-size": "~2.1.0",
+ "gulp": "^4.0.0",
+ "gulp-concat": "^2.6.0",
+ "gulp-connect": "^5.6.1",
+ "gulp-eslint": "^5.0.0",
+ "gulp-file": "^0.4.0",
+ "gulp-htmllint": "^0.0.16",
+ "gulp-insert": "^0.5.0",
+ "gulp-replace": "^1.0.0",
+ "gulp-size": "^3.0.0",
"gulp-streamify": "^1.0.2",
- "gulp-uglify": "~3.0.x",
- "gulp-util": "~3.0.x",
- "gulp-zip": "~4.0.0",
- "jasmine": "^2.8.0",
- "jasmine-core": "^2.8.0",
- "karma": "^1.7.1",
+ "gulp-uglify": "^3.0.0",
+ "gulp-util": "^3.0.0",
+ "gulp-zip": "^4.2.0",
+ "jasmine": "^3.3.0",
+ "jasmine-core": "^3.3.0",
+ "karma": "^3.1.1",
"karma-browserify": "^5.1.1",
"karma-chrome-launcher": "^2.2.0",
"karma-coverage": "^1.1.1",
"karma-firefox-launcher": "^1.0.1",
- "karma-jasmine": "^1.1.0",
- "karma-jasmine-html-reporter": "^0.2.2",
+ "karma-jasmine": "^2.0.0",
+ "karma-jasmine-html-reporter": "^1.4.0",
"merge-stream": "^1.0.1",
"pixelmatch": "^4.0.2",
- "vinyl-source-stream": "^1.1.0",
+ "vinyl-source-stream": "^2.0.0",
"watchify": "^3.9.0",
- "yargs": "^9.0.1"
+ "yargs": "^12.0.2"
},
"spm": {
"main": "Chart.js"
var supports = false;
try {
var options = Object.defineProperty({}, 'passive', {
+ // eslint-disable-next-line getter-return
get: function() {
supports = true;
}
// we can't use save() and restore() to restore the initial state. So make sure that at
// least the canvas context is reset to the default state by setting the canvas width.
// https://www.w3.org/TR/2011/WD-html5-20110525/the-canvas-element.html
+ // eslint-disable-next-line no-self-assign
canvas.width = canvas.width;
delete canvas[EXPANDO_KEY];
var meta = chart.getDatasetMeta(0);
var point = meta.data[1];
- var node = chart.canvas;
- var rect = node.getBoundingClientRect();
-
- var evt = new MouseEvent('mousemove', {
- view: window,
- bubbles: true,
- cancelable: true,
- clientX: rect.left + point._model.x,
- clientY: 0
- });
-
- // Manually trigger rather than having an async test
- node.dispatchEvent(evt);
+ jasmine.triggerMouseEvent(chart, 'mousemove', point);
// Check and see if tooltip was displayed
var tooltip = chart.tooltip;
expect(chart.lastActive).toEqual([point]);
- expect(tooltip._lastActive).toEqual([]);
+ expect(tooltip._lastActive).toEqual([point]);
// Update and confirm tooltip is reset
chart.update();
expect(plugin.hook).toHaveBeenCalled();
expect(plugin.hook.calls.first().args[1]).toEqual({a: 42});
+
+ delete Chart.defaults.global.plugins.a;
});