diff options
author | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-28 12:57:52 +0100 |
---|---|---|
committer | Ulrich-Matthias Schäfer <ulima.ums@googlemail.com> | 2018-11-28 12:57:52 +0100 |
commit | 58fd0d68bc8b46b23f8cdc65190f08d4e524eb57 (patch) | |
tree | 04247b959cb0517eb4a891c6afbabb734bb892bb /spec | |
parent | 08b27426fa631a6200a5423161770acab50403bd (diff) | |
download | svg.js-58fd0d68bc8b46b23f8cdc65190f08d4e524eb57.tar.gz svg.js-58fd0d68bc8b46b23f8cdc65190f08d4e524eb57.zip |
Fix build chain so that we now have multiple builds. Details below:
- svg.js: The esm bundle
- svg.min.js: The bundle for all browsers for maximum support
- svg.node.js: The bundle for node
- polyfill.js: Using svg.min.js requires this polyfill in case the Browser does not understand all of ./config/polyfillList.js
- polyfillIE.js: This is required when you use IE11 (polyfill.js still required)
Please note, that not all test pass for IE11 due to its rounding issues and wrong calculation of bbox.
Also note, that `defaultPrevented` is not working for CustomEvents in IE11.
Diffstat (limited to 'spec')
-rw-r--r-- | spec/SpecRunner.html | 4 | ||||
-rw-r--r-- | spec/spec/arrange.js | 15 | ||||
-rw-r--r-- | spec/spec/event.js | 3 | ||||
-rw-r--r-- | spec/spec/helper.js | 2 | ||||
-rw-r--r-- | spec/spec/morphing.js | 20 | ||||
-rw-r--r-- | spec/spec/runner.js | 10 | ||||
-rw-r--r-- | spec/spec/svg.js | 4 |
7 files changed, 24 insertions, 34 deletions
diff --git a/spec/SpecRunner.html b/spec/SpecRunner.html index 9d84677..c24aac5 100644 --- a/spec/SpecRunner.html +++ b/spec/SpecRunner.html @@ -15,7 +15,9 @@ <link rel="stylesheet" href="fixtures/fixture.css"> <!-- include source files here... --> - <script src="../dist/svg.js" charset="utf-8"></script> + <script src="../dist/polyfills.js" charset="utf-8"></script> + <script src="../dist/polyfillsIE.js" charset="utf-8"></script> + <script src="../dist/svg.min.js" charset="utf-8"></script> </head> diff --git a/spec/spec/arrange.js b/spec/spec/arrange.js index 89ece9c..ea0ea2b 100644 --- a/spec/spec/arrange.js +++ b/spec/spec/arrange.js @@ -58,6 +58,7 @@ describe('Arrange', function() { it('keeps the defs on top of the stack', function() { draw.defs() e3.forward() + expect(draw.node.childNodes[2+parserInDoc]).toBe(e3.node) expect(draw.node.childNodes[3+parserInDoc]).toBe(draw.defs().node) }) @@ -169,17 +170,3 @@ describe('Arrange', function() { }) }) - - - - - - - - - - - - - - diff --git a/spec/spec/event.js b/spec/spec/event.js index 83d173a..8515d21 100644 --- a/spec/spec/event.js +++ b/spec/spec/event.js @@ -270,7 +270,8 @@ describe('Event', function() { rect.on('event', function(e) { e.preventDefault() }) - expect(rect.dispatch('event').defaultPrevented).toBe(true) + var event = rect.dispatch('event') + expect(event.defaultPrevented).toBe(true) }) }) }) diff --git a/spec/spec/helper.js b/spec/spec/helper.js index f8992ac..4c9fe4a 100644 --- a/spec/spec/helper.js +++ b/spec/spec/helper.js @@ -183,6 +183,6 @@ window.roundMatrix = function (mat) { +(mat.c.toFixed(5)), +(mat.d.toFixed(5)), +(mat.e.toFixed(5)), - +(mat.f.toFixed(5)), + +(mat.f.toFixed(5)) ) } diff --git a/spec/spec/morphing.js b/spec/spec/morphing.js index 0557428..505440f 100644 --- a/spec/spec/morphing.js +++ b/spec/spec/morphing.js @@ -29,7 +29,7 @@ describe('Morphing', function () { expect(morpher.at(0.5).valueOf()).toEqual(jasmine.objectContaining({a: 7.5, b: 15})) }) - it(`Creates a morphable out of an SVG.Number`, function () { + it('Creates a morphable out of an SVG.Number', function () { var morpher = new SVG.Number(5).to(10) expect(morpher instanceof SVG.Morphable).toBe(true) @@ -38,7 +38,7 @@ describe('Morphing', function () { expect(morpher.at(0.5).valueOf()).toBe(7.5) }) - it(`Creates a morphable out of an SVG.Color`, function () { + it('Creates a morphable out of an SVG.Color', function () { var morpher = new SVG.Color('#fff').to('#000') expect(morpher instanceof SVG.Morphable).toBe(true) @@ -47,7 +47,7 @@ describe('Morphing', function () { expect(morpher.at(0.5).toHex()).toBe('#808080') }) - it(`Creates a morphable out of an SVG.Box`, function () { + it('Creates a morphable out of an SVG.Box', function () { var morpher = new SVG.Box(1, 2, 3, 4).to([5, 6, 7, 8]) expect(morpher instanceof SVG.Morphable).toBe(true) @@ -56,7 +56,7 @@ describe('Morphing', function () { expect(morpher.at(0.5)).toEqual(jasmine.objectContaining({x: 3, y: 4, width: 5, height: 6})) }) - it(`Creates a morphable out of an SVG.Matrix`, function () { + it('Creates a morphable out of an SVG.Matrix', function () { var morpher = new SVG.Matrix(1, 2, 3, 4, 5, 6).to([3, 4, 5, 6, 7, 8]) expect(morpher instanceof SVG.Morphable).toBe(true) @@ -65,7 +65,7 @@ describe('Morphing', function () { expect(morpher.at(0.5)).toEqual(jasmine.objectContaining(new SVG.Matrix(2, 3, 4, 5, 6, 7))) }) - it(`Creates a morphable out of an SVG.Array`, function () { + it('Creates a morphable out of an SVG.Array', function () { var morpher = new SVG.Array([1,2,3,4,5,6]).to([3,4,5,6,7,8]) expect(morpher instanceof SVG.Morphable).toBe(true) @@ -74,7 +74,7 @@ describe('Morphing', function () { expect(morpher.at(0.5).toArray()).toEqual(jasmine.arrayContaining([2, 3, 4, 5, 6, 7])) }) - it(`Creates a morphable out of an SVG.PointArray`, function () { + it('Creates a morphable out of an SVG.PointArray', function () { var morpher = new SVG.PointArray([1, 2, 3, 4, 5, 6]).to([3, 4, 5, 6, 7, 8]) expect(morpher instanceof SVG.Morphable).toBe(true) @@ -83,7 +83,7 @@ describe('Morphing', function () { expect(morpher.at(0.5).toArray()).toEqual(jasmine.arrayContaining([2, 3, 4, 5, 6, 7])) }) - it(`Creates a morphable out of an SVG.PathArray`, function () { + it('Creates a morphable out of an SVG.PathArray', function () { var morpher = new SVG.PathArray(['M', 1, 2, 'L', 3, 4, 'L', 5, 6]).to(['M', 3, 4, 'L', 5, 6, 'L', 7, 8]) expect(morpher instanceof SVG.Morphable).toBe(true) @@ -92,7 +92,7 @@ describe('Morphing', function () { expect(morpher.at(0.5).toArray()).toEqual(jasmine.arrayContaining(['M', 2, 3, 'L', 4, 5, 'L', 6, 7])) }) - it(`Creates a morphable out of an SVG.NonMorphable`, function () { + it('Creates a morphable out of an SVG.NonMorphable', function () { var morpher = new SVG.NonMorphable('foo').to('bar') expect(morpher instanceof SVG.Morphable).toBe(true) @@ -102,7 +102,7 @@ describe('Morphing', function () { expect(morpher.at(1).valueOf()).toBe('bar') }) - it(`Creates a morphable out of an SVG.TransformBag`, function () { + it('Creates a morphable out of an SVG.TransformBag', function () { var morpher = new SVG.TransformBag({rotate: 0, translateX: 0}) .to({rotate: 50, translateX: 20}) @@ -113,7 +113,7 @@ describe('Morphing', function () { expect(morpher.at(0.5)).toEqual(jasmine.objectContaining({rotate: 25, translateX: 10})) }) - it(`Creates a morphable out of an SVG.ObjectBag`, function () { + it('Creates a morphable out of an SVG.ObjectBag', function () { var morpher = new SVG.ObjectBag({a:5, b: 10}).to({a: 10, b: 20}) expect(morpher instanceof SVG.Morphable).toBe(true) diff --git a/spec/spec/runner.js b/spec/spec/runner.js index ff9df7b..2cda176 100644 --- a/spec/spec/runner.js +++ b/spec/spec/runner.js @@ -100,7 +100,7 @@ describe('SVG.Runner', function () { // return new orginalRunner() // }) // - // var element = SVG('<rect>') + // var element = SVG('<rect />') // var runner = element.animate() // expect(SVG.Runner).toHaveBeenCalled(); // expect(runner instanceof SVG.Runner) @@ -111,7 +111,7 @@ describe('SVG.Runner', function () { describe('delay()', function () { it('calls animate with correct parameters', function () { - var element = SVG('<rect>') + var element = SVG('<rect />') spyOn(element, 'animate') element.delay(100, 'now') @@ -662,14 +662,14 @@ describe('SVG.Runner', function () { var runner1 = new SVG.Runner() expect(runner1.element()).toBe(null) - var element = SVG('<rect>') + var element = SVG('<rect />') var runner2 = element.animate() expect(runner2.element()).toBe(element) }) it('sets an element to be bound to the runner', function () { var runner = new SVG.Runner() - var element = SVG('<rect>') + var element = SVG('<rect />') expect(runner.element(element)).toBe(runner) expect(runner.element()).toBe(element) }) @@ -680,7 +680,7 @@ describe('SVG.Runner', function () { var runner1 = new SVG.Runner() expect(runner1.element()).toBe(null) - var element = SVG('<rect>') + var element = SVG('<rect />') var runner2 = element.animate() expect(runner2.timeline()).toBe(element.timeline()) }) diff --git a/spec/spec/svg.js b/spec/spec/svg.js index a3e33b5..57db8e0 100644 --- a/spec/spec/svg.js +++ b/spec/spec/svg.js @@ -62,8 +62,8 @@ describe('SVG', function() { }) it('creates SVG.Shape from any shape string', function() { - var rect = SVG('<rect width="200" height="100">') - , circle = SVG('<circle r="200">') + var rect = SVG('<rect width="200" height="100" />') + , circle = SVG('<circle r="200" />') expect(rect instanceof SVG.Rect).toBe(true) expect(rect.node.nodeName).toBe('rect') |