]> git.ipfire.org Git - thirdparty/Chart.js.git/commitdiff
Automatically expose custom Jasmine matchers 3287/head
authorSimon Brunel <simonbrunel@users.noreply.github.com>
Thu, 8 Sep 2016 21:29:39 +0000 (23:29 +0200)
committerSimon Brunel <simonbrunel@users.noreply.github.com>
Thu, 8 Sep 2016 21:32:47 +0000 (23:32 +0200)
14 files changed:
test/controller.bar.tests.js
test/controller.bubble.tests.js
test/controller.doughnut.tests.js
test/controller.line.tests.js
test/controller.polarArea.tests.js
test/controller.radar.tests.js
test/core.layoutService.tests.js
test/core.legend.tests.js
test/core.tooltip.tests.js
test/mockContext.js
test/scale.linear.tests.js
test/scale.logarithmic.tests.js
test/scale.radialLinear.tests.js
test/scale.time.tests.js

index 427818723b9b3af33dfa975379739eaf686bb938..3ef9cabdf52f76c12d9785aea4b120142a5e4811 100644 (file)
@@ -1,10 +1,5 @@
 // Test the bar controller
 describe('Bar controller tests', function() {
-
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('should be constructed', function() {
                var chart = window.acquireChart({
                        type: 'bar',
index ad81bd544885744af2a4e678c95195db51eff552..ec61a0b50bcad0fc303232ff9ed97ee8acf8ea0e 100644 (file)
@@ -1,10 +1,5 @@
 // Test the bubble controller
 describe('Bubble controller tests', function() {
-
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('should be constructed', function() {
                var chart = window.acquireChart({
                        type: 'bubble',
index 0fac90d586013363c4c1880e0580da06d4130ce6..0d31653a733522bf44cd3e0d9231eaaa8f929ab7 100644 (file)
@@ -1,10 +1,5 @@
 // Test the bar controller
 describe('Doughnut controller tests', function() {
-
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('should be constructed', function() {
                var chart = window.acquireChart({
                        type: 'doughnut',
index 70535ace90c4277359850669a0c50cad2669c3e5..9afc9cec0555157091c83287479a2b56cc75e488 100644 (file)
@@ -1,10 +1,5 @@
 // Test the line controller
 describe('Line controller tests', function() {
-
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('should be constructed', function() {
                var chart = window.acquireChart({
                        type: 'line',
index 43f200d13997593f49fedc413f8f18ac2105c8d4..648117a4c10b19a240f508ae8be3a493a54f44a0 100644 (file)
@@ -1,10 +1,5 @@
 // Test the polar area controller
 describe('Polar area controller tests', function() {
-
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('should be constructed', function() {
                var chart = window.acquireChart({
                type: 'polarArea',
index c99219588c38d56307c4fce04899078ace3412b4..421ff9eb38831df54bc8b3b03a756b10307a7ea4 100644 (file)
@@ -1,9 +1,5 @@
 // Test the polar area controller
 describe('Radar controller tests', function() {
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('Should be constructed', function() {
                var chart = window.acquireChart({
                        type: 'radar',
index 024b379e093ebee42e7100d619eba71459573b42..860b4b64900be531aed44f1d9483a12f3a545633 100644 (file)
@@ -1,9 +1,5 @@
 // Tests of the scale service
 describe('Test the layout service', function() {
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('should fit a simple chart with 2 scales', function() {
                var chart = window.acquireChart({
                        type: 'bar',
index ee42b098cd5da506df0812f508704efcb5a3e8af..caa35883a195502d6a53a3d27194d5e90febfacb 100644 (file)
@@ -1,10 +1,5 @@
 // Test the rectangle element
 describe('Legend block tests', function() {
-
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('Should be constructed', function() {
                var legend = new Chart.Legend({});
                expect(legend).not.toBe(undefined);
index 82723fb70218ee15eb46af5687f3ff9dad2e486d..21d25ebaa16c8fffeef22036e6da85f71905d8ab 100755 (executable)
@@ -1,10 +1,5 @@
 // Test the rectangle element
 describe('tooltip tests', function() {
-
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('Should display in label mode', function() {
                var chartInstance = window.acquireChart({
                        type: 'line',
index db91fee26747c902e6bd7c9cc9825ad9eddf08ff..9590b53608c3c710128636550991881c0ac70ed1 100644 (file)
                };
        }
 
-       window.addDefaultMatchers = function(jasmine) {
+       beforeEach(function() {
                jasmine.addMatchers({
                        toBeCloseToPixel: toBeCloseToPixel,
                        toEqualOneOf: toEqualOneOf
                });
-       }
+       });
 
        // Canvas injection helpers
        var charts = {};
index 549424ddd58b66e256756f18ec3dbcbbb9009317..659ccc727cd1d28311475adac574684ce3a1f31f 100644 (file)
@@ -1,8 +1,4 @@
 describe('Linear Scale', function() {
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('Should register the constructor with the scale service', function() {
                var Constructor = Chart.scaleService.getScaleConstructor('linear');
                expect(Constructor).not.toBe(undefined);
index dc5d8b4f69e67e64c2837710c808fd189014d3e1..be6350341e96bfafcf02e6d59c0eebd618f5cb54 100644 (file)
@@ -1,9 +1,4 @@
 describe('Logarithmic Scale tests', function() {
-
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('should register the constructor with the scale service', function() {
                var Constructor = Chart.scaleService.getScaleConstructor('logarithmic');
                expect(Constructor).not.toBe(undefined);
index ce269b12d1d25e32bbf51670de851e28189481fa..61b6d96891747318ede2d6b47b192887dd723091 100644 (file)
@@ -1,9 +1,5 @@
 // Tests for the radial linear scale used by the polar area and radar charts
 describe('Test the radial linear scale', function() {
-       beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-       });
-
        it('Should register the constructor with the scale service', function() {
                var Constructor = Chart.scaleService.getScaleConstructor('radialLinear');
                expect(Constructor).not.toBe(undefined);
index c37910934ba761bad6cc63f9ec745ccb76470769..5179191bafac4bedf0f416351cf12527a9aa1602 100755 (executable)
@@ -1,8 +1,6 @@
 // Time scale tests
 describe('Time scale tests', function() {
        beforeEach(function() {
-               window.addDefaultMatchers(jasmine);
-
                // Need a time matcher for getValueFromPixel
                jasmine.addMatchers({
                        toBeCloseToTime: function() {