]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Make test Context an ES6 module (#7142)
authorBen McCann <322311+benmccann@users.noreply.github.com>
Sun, 23 Feb 2020 13:08:06 +0000 (05:08 -0800)
committerGitHub <noreply@github.com>
Sun, 23 Feb 2020 13:08:06 +0000 (08:08 -0500)
* Make test Context an ES6 module

* Address comments

karma.conf.js
test/context.js

index 8fc9bfa525264c9ef7df81746214916682fb81fc..2f115617e559dc36a9b564cc2f7554d0c981b2e5 100644 (file)
@@ -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',
index 42b399d9f366b036bdee4fe1b2316791d68444d5..d37324f284902bfb4d4f6ad553f3b51b40bb1d98 100644 (file)
@@ -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;