From: Ben McCann <322311+benmccann@users.noreply.github.com> Date: Sun, 23 Feb 2020 13:08:06 +0000 (-0800) Subject: Make test Context an ES6 module (#7142) X-Git-Tag: v3.0.0-alpha~22 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f3ef620c6876ad13188f5c95f65b010952d219ea;p=thirdparty%2FChart.js.git Make test Context an ES6 module (#7142) * Make test Context an ES6 module * Address comments --- diff --git a/karma.conf.js b/karma.conf.js index 8fc9bfa52..2f115617e 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -68,7 +68,7 @@ module.exports = function(karma) { plugins: [ resolve(), babel({exclude: 'node_modules/**'}), // use babel since we have ES proposal features - commonjs() + commonjs({exclude: ['src/**', 'test/**']}) ], output: { name: 'test', diff --git a/test/context.js b/test/context.js index 42b399d9f..d37324f28 100644 --- a/test/context.js +++ b/test/context.js @@ -1,5 +1,5 @@ // Code from https://stackoverflow.com/questions/4406864/html-canvas-unit-testing -var Context = function() { +const Context = function() { this._calls = []; // names/args of recorded calls this._initMethods(); @@ -136,4 +136,4 @@ Context.prototype.resetCalls = function() { this._calls = []; }; -module.exports = Context; +export default Context;