From ba52ca3a54f34d2f60fcc4fc3d223c4474b72cd8 Mon Sep 17 00:00:00 2001 From: Roman Bruckner Date: Mon, 13 Jan 2025 23:22:35 +0800 Subject: [PATCH] chore: fix various code quality issues (#2852) --- examples/dwdm/src/shapes/utils.ts | 4 +- examples/isometric/index.html | 2 +- .../isometric/src/shapes/isometric-shape.ts | 3 +- examples/isometric/src/utils.ts | 2 +- .../demo/archive/joint.dia.LegacyLinkView.js | 4 +- .../demo/archive/pipes/src/pipes.js | 4 +- packages/joint-core/demo/requirejs/index.html | 2 + packages/joint-core/demo/vuejs/index.html | 1 + packages/joint-core/src/V/index.mjs | 2 +- packages/joint-core/src/dia/ElementView.mjs | 2 +- .../joint-core/src/dia/HighlighterView.mjs | 10 +- packages/joint-core/src/mvc/Collection.mjs | 8 +- packages/joint-core/src/mvc/Dom/Dom.mjs | 4 +- packages/joint-core/src/mvc/Dom/methods.mjs | 16 +- packages/joint-core/src/mvc/Model.mjs | 8 +- packages/joint-core/src/mvc/ViewBase.mjs | 8 +- packages/joint-core/src/util/util.mjs | 9 +- packages/joint-core/src/util/utilHelpers.mjs | 4 +- packages/joint-core/test/geometry/bezier.js | 10 +- packages/joint-core/test/geometry/ellipse.js | 10 +- packages/joint-core/test/geometry/index.html | 2 +- packages/joint-core/test/geometry/line.js | 8 +- packages/joint-core/test/geometry/path.js | 4 +- packages/joint-core/test/geometry/point.js | 28 +-- packages/joint-core/test/geometry/rect.js | 32 +-- .../joint-core/test/geometry/requirejs.html | 2 +- .../joint-core/test/jointjs/browserify.html | 2 +- packages/joint-core/test/jointjs/cellView.js | 4 +- packages/joint-core/test/jointjs/core/util.js | 28 +-- packages/joint-core/test/jointjs/index.html | 2 +- .../joint-core/test/jointjs/mvc.collection.js | 4 +- .../joint-core/test/jointjs/mvc.events.js | 192 +++++++++--------- packages/joint-core/test/jointjs/mvc.model.js | 178 ++++++++-------- packages/joint-core/test/jointjs/mvc.view.js | 2 +- packages/joint-core/test/jointjs/paper.js | 4 +- .../joint-core/test/jointjs/requirejs.html | 2 +- .../joint-core/test/jointjs/utilHelpers.js | 28 +-- packages/joint-core/test/jointjs/webpack.html | 2 +- .../joint-core/test/vectorizer/index.html | 2 +- .../joint-core/test/vectorizer/requirejs.html | 2 +- .../test/index.html | 2 +- .../test/requirejs/requirejs.html | 2 +- sonar-project.properties | 4 + 43 files changed, 337 insertions(+), 312 deletions(-) create mode 100644 sonar-project.properties diff --git a/examples/dwdm/src/shapes/utils.ts b/examples/dwdm/src/shapes/utils.ts index bdca69fca..a3adee2bb 100644 --- a/examples/dwdm/src/shapes/utils.ts +++ b/examples/dwdm/src/shapes/utils.ts @@ -2,11 +2,11 @@ import { dia } from '@joint/core'; export function isCellHidden(cell: dia.Cell): boolean { return Boolean(cell.get('hidden')); -}; +} export function setCellVisibility(cell: dia.Cell, visible: boolean): void { cell.set('hidden', !visible); -}; +} export function getPortLinks(graph: dia.Graph, element: dia.Element, portId: dia.Cell.ID): dia.Link[] { const outboundLinks = graph.getConnectedLinks(element, { outbound: true }).filter((link) => { diff --git a/examples/isometric/index.html b/examples/isometric/index.html index 59cb522fd..59ee89a3a 100644 --- a/examples/isometric/index.html +++ b/examples/isometric/index.html @@ -10,7 +10,7 @@
- + diff --git a/examples/isometric/src/shapes/isometric-shape.ts b/examples/isometric/src/shapes/isometric-shape.ts index 4915c0b9f..3c7d8aa3d 100644 --- a/examples/isometric/src/shapes/isometric-shape.ts +++ b/examples/isometric/src/shapes/isometric-shape.ts @@ -86,8 +86,7 @@ export default class IsometricShape extends dia.Element + + JointJS Core | require.js | test suite diff --git a/packages/joint-core/demo/vuejs/index.html b/packages/joint-core/demo/vuejs/index.html index 5c0bf9fa4..7b6484e02 100644 --- a/packages/joint-core/demo/vuejs/index.html +++ b/packages/joint-core/demo/vuejs/index.html @@ -1,3 +1,4 @@ + diff --git a/packages/joint-core/src/V/index.mjs b/packages/joint-core/src/V/index.mjs index 65e57c9c0..fbc7dd463 100644 --- a/packages/joint-core/src/V/index.mjs +++ b/packages/joint-core/src/V/index.mjs @@ -472,8 +472,8 @@ const V = (function() { case 'bottom': dy = -(0.25 * llMaxFont) - rLineHeights; break; - default: case 'top': + default: dy = (0.8 * flMaxFont); break; } diff --git a/packages/joint-core/src/dia/ElementView.mjs b/packages/joint-core/src/dia/ElementView.mjs index e86390054..a30fd67ec 100644 --- a/packages/joint-core/src/dia/ElementView.mjs +++ b/packages/joint-core/src/dia/ElementView.mjs @@ -142,7 +142,7 @@ export const ElementView = CellView.extend({ * @abstract */ _initializePorts: function() { - + // implemented in ports.js }, update: function(_, renderingOnlyAttrs) { diff --git a/packages/joint-core/src/dia/HighlighterView.mjs b/packages/joint-core/src/dia/HighlighterView.mjs index ed4b4ac16..ced89ed00 100644 --- a/packages/joint-core/src/dia/HighlighterView.mjs +++ b/packages/joint-core/src/dia/HighlighterView.mjs @@ -42,13 +42,13 @@ export const HighlighterView = mvc.View.extend({ // The cellView is now rendered/updated since it has a higher update priority. this.updateRequested = false; const { cellView, nodeSelector } = this; - if (!cellView.isMounted()) { + if (cellView.isMounted()) { + this.update(cellView, nodeSelector); + this.mount(); + this.transform(); + } else { this.postponedUpdate = true; - return 0; } - this.update(cellView, nodeSelector); - this.mount(); - this.transform(); return 0; }, diff --git a/packages/joint-core/src/mvc/Collection.mjs b/packages/joint-core/src/mvc/Collection.mjs index 54d0740d6..9df3320bc 100644 --- a/packages/joint-core/src/mvc/Collection.mjs +++ b/packages/joint-core/src/mvc/Collection.mjs @@ -59,11 +59,15 @@ assign(Collection.prototype, Events, { // preinitialize is an empty function by default. You can override it with a function // or object. preinitialize will run before any instantiation logic is run in the Collection. - preinitialize: function(){}, + preinitialize: function(){ + // No implementation. + }, // Initialize is an empty function by default. Override it with your own // initialization logic. - initialize: function(){}, + initialize: function(){ + // No implementation. + }, // The JSON representation of a Collection is an array of the // models' attributes. diff --git a/packages/joint-core/src/mvc/Dom/Dom.mjs b/packages/joint-core/src/mvc/Dom/Dom.mjs index 4f1bbe2d5..06d6c7e27 100644 --- a/packages/joint-core/src/mvc/Dom/Dom.mjs +++ b/packages/joint-core/src/mvc/Dom/Dom.mjs @@ -109,8 +109,8 @@ $.fn.find = function(selector) { return ret; }; -$.fn.add = function(selector, context) { - const newElements = $(selector, context).toArray(); +$.fn.add = function(selector) { + const newElements = $(selector).toArray(); const prevElements = this.toArray(); const ret = this.pushStack([]); $.merge(ret, uniq(prevElements.concat(newElements))); diff --git a/packages/joint-core/src/mvc/Dom/methods.mjs b/packages/joint-core/src/mvc/Dom/methods.mjs index 28958f155..7cb54cbdd 100644 --- a/packages/joint-core/src/mvc/Dom/methods.mjs +++ b/packages/joint-core/src/mvc/Dom/methods.mjs @@ -65,7 +65,7 @@ export function html(html) { if (!el) return null; if (arguments.length === 0) return el.innerHTML; if (html === undefined) return this; // do nothing - cleanNodesData(dataPriv, el.getElementsByTagName('*')); + cleanNodesData(el.getElementsByTagName('*')); if (typeof html === 'string' || typeof html === 'number') { el.innerHTML = html; } else { @@ -336,17 +336,19 @@ export function position() { // when a statically positioned element is identified doc = el.ownerDocument; offsetParent = el.offsetParent || doc.documentElement; - const $parentOffset = $(offsetParent); - const parentOffsetElementPosition = $parentOffset.css('position') || 'static'; - while ( offsetParent && (offsetParent === doc.body || offsetParent === doc.documentElement) && parentOffsetElementPosition === 'static') { - offsetParent = offsetParent.parentNode; + const isStaticallyPositioned = (el) => { + const { position } = el.style; + return !position || position === 'static'; + }; + while (offsetParent && offsetParent !== doc.documentElement && isStaticallyPositioned(offsetParent)) { + offsetParent = offsetParent.offsetParent || doc.documentElement; } - if (offsetParent && offsetParent !== el && offsetParent.nodeType === 1) { + if (offsetParent && offsetParent !== el && offsetParent.nodeType === 1 && !isStaticallyPositioned(offsetParent)) { // Incorporate borders into its offset, since they are outside its content origin const offsetParentStyles = window.getComputedStyle(offsetParent); const borderTopWidth = parseFloat(offsetParentStyles.borderTopWidth) || 0; const borderLeftWidth = parseFloat(offsetParentStyles.borderLeftWidth) || 0; - parentOffset = $parentOffset.offset(); + parentOffset = $(offsetParent).offset(); parentOffset.top += borderTopWidth; parentOffset.left += borderLeftWidth; } diff --git a/packages/joint-core/src/mvc/Model.mjs b/packages/joint-core/src/mvc/Model.mjs index 2ccc61e02..ccc087b72 100644 --- a/packages/joint-core/src/mvc/Model.mjs +++ b/packages/joint-core/src/mvc/Model.mjs @@ -59,11 +59,15 @@ assign(Model.prototype, Events, { // preinitialize is an empty function by default. You can override it with a function // or object. preinitialize will run before any instantiation logic is run in the Model. - preinitialize: function(){}, + preinitialize: function(){ + // No implementation. + }, // Initialize is an empty function by default. Override it with your own // initialization logic. - initialize: function(){}, + initialize: function(){ + // No implementation. + }, // Return a copy of the model's `attributes` object. toJSON: function(options) { diff --git a/packages/joint-core/src/mvc/ViewBase.mjs b/packages/joint-core/src/mvc/ViewBase.mjs index 01ed015cb..9a3e04ef7 100644 --- a/packages/joint-core/src/mvc/ViewBase.mjs +++ b/packages/joint-core/src/mvc/ViewBase.mjs @@ -52,11 +52,15 @@ assign(ViewBase.prototype, Events, { // preinitialize is an empty function by default. You can override it with a function // or object. preinitialize will run before any instantiation logic is run in the View - preinitialize: function(){}, + preinitialize: function(){ + // No implementation. + }, // Initialize is an empty function by default. Override it with your own // initialization logic. - initialize: function(){}, + initialize: function(){ + // No implementation. + }, // **render** is the core function that your view should override, in order // to populate its element (`this.el`), with the appropriate HTML. The diff --git a/packages/joint-core/src/util/util.mjs b/packages/joint-core/src/util/util.mjs index c1873d89a..a28bd6768 100644 --- a/packages/joint-core/src/util/util.mjs +++ b/packages/joint-core/src/util/util.mjs @@ -79,10 +79,10 @@ export const parseDOMJSON = function(json, namespace) { const groupSelectors = {}; const svgNamespace = V.namespace.svg; - const ns = namespace || svgNamespace; + const initialNS = namespace || svgNamespace; const fragment = document.createDocumentFragment(); - const parseNode = function(siblingsDef, parentNode, ns) { + const parseNode = function(siblingsDef, parentNode, parentNS) { for (let i = 0; i < siblingsDef.length; i++) { const nodeDef = siblingsDef[i]; @@ -100,7 +100,7 @@ export const parseDOMJSON = function(json, namespace) { let node; // Namespace URI - if (nodeDef.hasOwnProperty('namespaceURI')) ns = nodeDef.namespaceURI; + const ns = (nodeDef.hasOwnProperty('namespaceURI')) ? nodeDef.namespaceURI : parentNS; node = document.createElementNS(ns, tagName); const svg = (ns === svgNamespace); @@ -152,7 +152,7 @@ export const parseDOMJSON = function(json, namespace) { } } }; - parseNode(json, fragment, ns); + parseNode(json, fragment, initialNS); return { fragment: fragment, selectors: selectors, @@ -1790,4 +1790,5 @@ export { }; export const noop = function() { + // Do nothing. }; diff --git a/packages/joint-core/src/util/utilHelpers.mjs b/packages/joint-core/src/util/utilHelpers.mjs index f5a170750..664946a29 100644 --- a/packages/joint-core/src/util/utilHelpers.mjs +++ b/packages/joint-core/src/util/utilHelpers.mjs @@ -389,7 +389,7 @@ const initCloneByTag = (object, tag, isDeep) => { const Constructor = object.constructor; switch(tag) { case arrayBufferTag: - return cloneArrayBuffer(object, isDeep); + return cloneArrayBuffer(object); case boolTag: case dateTag: return new Constructor(+object); @@ -1281,7 +1281,7 @@ function last(array) { const createSet = (Set && (1 / setToArray(new Set([undefined,-0]))[1]) == 1 / 0) ? (values) => new Set(values) - : () => {}; + : () => { /* no-op */ }; function customDefaultsMerge(objValue, srcValue, key, object, source, stack) { if (isObject(objValue) && isObject(srcValue)) { diff --git a/packages/joint-core/test/geometry/bezier.js b/packages/joint-core/test/geometry/bezier.js index deb4fe2db..7198a8f4b 100644 --- a/packages/joint-core/test/geometry/bezier.js +++ b/packages/joint-core/test/geometry/bezier.js @@ -3,22 +3,22 @@ QUnit.module('bezier', function() { QUnit.module('curveThroughPoints(points)', function() { - + // TODO: implement }); QUnit.module('getCurveControlPoints(knots)', function() { - + // TODO: implement }); QUnit.module('getCurveDivider(p0, p1, p2, p3)', function() { - + // TODO: implement }); QUnit.module('getFirstControlPoints(rhs)', function() { - + // TODO: implement }); QUnit.module('getInversionSolver(p0, p1, p2, p3)', function() { - + // TODO: implement }); }); diff --git a/packages/joint-core/test/geometry/ellipse.js b/packages/joint-core/test/geometry/ellipse.js index 695a8b6e0..1a5fc30b0 100644 --- a/packages/joint-core/test/geometry/ellipse.js +++ b/packages/joint-core/test/geometry/ellipse.js @@ -133,19 +133,19 @@ QUnit.module('ellipse', function() { QUnit.module('prototype', function() { QUnit.module('bbox()', function() { - + // TODO: implement }); QUnit.module('clone()', function() { - + // TODO: implement }); QUnit.module('equals(ellipse)', function() { - + // TODO: implement }); QUnit.module('intersectionWithLineFromCenterToPoint(point, angle)', function() { - + // TODO: implement }); QUnit.module('round()', function() { @@ -180,7 +180,7 @@ QUnit.module('ellipse', function() { }); QUnit.module('toString()', function() { - + // TODO: implement }); }); }); diff --git a/packages/joint-core/test/geometry/index.html b/packages/joint-core/test/geometry/index.html index 74d01d45c..41e48d1e3 100644 --- a/packages/joint-core/test/geometry/index.html +++ b/packages/joint-core/test/geometry/index.html @@ -1,5 +1,5 @@ - + Geometry | Tests diff --git a/packages/joint-core/test/geometry/line.js b/packages/joint-core/test/geometry/line.js index 179ed72e3..e2ccc5835 100644 --- a/packages/joint-core/test/geometry/line.js +++ b/packages/joint-core/test/geometry/line.js @@ -460,11 +460,11 @@ QUnit.module('line', function() { }); QUnit.module('length()', function() { - + // TODO: implement }); QUnit.module('midpoint()', function() { - + // TODO: implement }); QUnit.module('pointAt()', function() { @@ -773,7 +773,7 @@ QUnit.module('line', function() { }); QUnit.module('squaredLength()', function() { - + // TODO: implement }); QUnit.module('tangentAt()', function() { @@ -873,7 +873,7 @@ QUnit.module('line', function() { }); QUnit.module('toString()', function() { - + // TODO: implement }); QUnit.module('serialize()', function() { diff --git a/packages/joint-core/test/geometry/path.js b/packages/joint-core/test/geometry/path.js index 27b4ecc9b..809311f64 100644 --- a/packages/joint-core/test/geometry/path.js +++ b/packages/joint-core/test/geometry/path.js @@ -2774,7 +2774,7 @@ QUnit.module('path', function(hooks) { }); QUnit.module('lengthAtT()', function() { - + // TODO: implement }); QUnit.module('pointAt()', function() { @@ -3151,7 +3151,7 @@ QUnit.module('path', function(hooks) { }); QUnit.module('pointAtT()', function() { - + // TODO: implement }); QUnit.module('removeSegment()', function() { diff --git a/packages/joint-core/test/geometry/point.js b/packages/joint-core/test/geometry/point.js index 3e037b2aa..9d0a26a08 100644 --- a/packages/joint-core/test/geometry/point.js +++ b/packages/joint-core/test/geometry/point.js @@ -20,11 +20,11 @@ QUnit.module('point', function() { }); QUnit.module('fromPolar(distance, angle, origin)', function() { - + // TODO: implement }); QUnit.module('random(x1, x2, y1, y2)', function() { - + // TODO: implement }); QUnit.module('prototype', function() { @@ -45,19 +45,19 @@ QUnit.module('point', function() { }); QUnit.module('adhereToRect(rect)', function() { - + // TODO: implement }); QUnit.module('bearing(point)', function() { - + // TODO: implement }); QUnit.module('changeInAngle(dx, dy, ref)', function() { - + // TODO: implement }); QUnit.module('clone()', function() { - + // TODO: implement }); QUnit.module('difference(point)', function() { @@ -71,23 +71,23 @@ QUnit.module('point', function() { }); QUnit.module('distance(point)', function() { - + // TODO: implement }); QUnit.module('equals(point)', function() { - + // TODO: implement }); QUnit.module('magnitude()', function() { - + // TODO: implement }); QUnit.module('manhattanDistance(point)', function() { - + // TODO: implement }); QUnit.module('move(ref, distance)', function() { - + // TODO: implement }); QUnit.module('normalize(length)', function() { @@ -116,7 +116,7 @@ QUnit.module('point', function() { }); QUnit.module('reflection(ref)', function() { - + // TODO: implement }); QUnit.module('rotate(origin, angle)', function() { @@ -244,7 +244,7 @@ QUnit.module('point', function() { }); QUnit.module('snapToGrid(gx, gy)', function() { - + // TODO: implement }); QUnit.module('theta(p)', function() { @@ -312,7 +312,7 @@ QUnit.module('point', function() { }); QUnit.module('toPolar(origin)', function() { - + // TODO: implement }); QUnit.module('toString()', function() { diff --git a/packages/joint-core/test/geometry/rect.js b/packages/joint-core/test/geometry/rect.js index 75752ce41..024aebde4 100644 --- a/packages/joint-core/test/geometry/rect.js +++ b/packages/joint-core/test/geometry/rect.js @@ -129,7 +129,7 @@ QUnit.module('rect', function() { }); QUnit.module('bottomLeft()', function() { - + // TODO: implement }); QUnit.module('bottomLine()', function() { @@ -149,15 +149,15 @@ QUnit.module('rect', function() { }); QUnit.module('bottomRight()', function() { - + // TODO: implement }); QUnit.module('center()', function() { - + // TODO: implement }); QUnit.module('clone()', function() { - + // TODO: implement }); QUnit.module('containsPoint(point)', function() { @@ -227,7 +227,7 @@ QUnit.module('rect', function() { }); QUnit.module('corner()', function() { - + // TODO: implement }); QUnit.module('equals(rect)', function() { @@ -269,11 +269,11 @@ QUnit.module('rect', function() { }); QUnit.module('intersect(rect)', function() { - + // TODO: implement }); QUnit.module('intersectionWithLineFromCenterToPoint(point, angle)', function() { - + // TODO: implement }); QUnit.module('leftLine()', function() { @@ -293,11 +293,11 @@ QUnit.module('rect', function() { }); QUnit.module('moveAndExpand(rect)', function() { - + // TODO: implement }); QUnit.module('normalize()', function() { - + // TODO: implement }); QUnit.module('offset(dx, dy)', function() { @@ -317,11 +317,11 @@ QUnit.module('rect', function() { }); QUnit.module('origin()', function() { - + // TODO: implement }); QUnit.module('pointNearestToPoint(point)', function() { - + // TODO: implement }); QUnit.module('rightLine()', function() { @@ -383,15 +383,15 @@ QUnit.module('rect', function() { }); QUnit.module('sideNearestToPoint(point)', function() { - + // TODO: implement }); QUnit.module('snapToGrid(gx, gy)', function() { - + // TODO: implement }); QUnit.module('topLeft()', function() { - + // TODO: implement }); QUnit.module('topLine()', function() { @@ -411,7 +411,7 @@ QUnit.module('rect', function() { }); QUnit.module('topRight()', function() { - + // TODO: implement }); QUnit.module('toJSON()', function() { @@ -423,7 +423,7 @@ QUnit.module('rect', function() { }); QUnit.module('toString()', function() { - + // TODO: implement }); QUnit.module('union(rect)', function() { diff --git a/packages/joint-core/test/geometry/requirejs.html b/packages/joint-core/test/geometry/requirejs.html index e576119c9..d70b6b0dc 100644 --- a/packages/joint-core/test/geometry/requirejs.html +++ b/packages/joint-core/test/geometry/requirejs.html @@ -1,5 +1,5 @@ - + Geometry | Tests | require.js diff --git a/packages/joint-core/test/jointjs/browserify.html b/packages/joint-core/test/jointjs/browserify.html index 8c8510999..cddc855c8 100644 --- a/packages/joint-core/test/jointjs/browserify.html +++ b/packages/joint-core/test/jointjs/browserify.html @@ -1,5 +1,5 @@ - + JointJS | Browserify | test suite diff --git a/packages/joint-core/test/jointjs/cellView.js b/packages/joint-core/test/jointjs/cellView.js index b7bcd8229..bcc409de3 100644 --- a/packages/joint-core/test/jointjs/cellView.js +++ b/packages/joint-core/test/jointjs/cellView.js @@ -287,7 +287,7 @@ QUnit.module('cellView', function(hooks) { )); delete cell.constructor.attributes['position-test-attribute']; - }), + }); QUnit.test('Basics', function(assert) { @@ -476,7 +476,7 @@ QUnit.module('cellView', function(hooks) { )); delete cell.constructor.attributes['offset-test-attribute']; - }), + }); QUnit.test('Basics', function(assert) { diff --git a/packages/joint-core/test/jointjs/core/util.js b/packages/joint-core/test/jointjs/core/util.js index 1ada2d9c9..636ea18e3 100644 --- a/packages/joint-core/test/jointjs/core/util.js +++ b/packages/joint-core/test/jointjs/core/util.js @@ -928,21 +928,23 @@ QUnit.module('util', function(hooks) { var someObject = { someFunction: function() { - + // no-op. }, someOtherFunction: function() { - + // no-op. }, yetAnotherFunction: function() { - + // no-op. } }; var methods = ['someFunction', 'someOtherFunction']; - var innerWrapper = function() { }; + var innerWrapper = function() { + // no-op + }; var wrapper = function() { @@ -954,10 +956,10 @@ QUnit.module('util', function(hooks) { _.each(someObject, function(fn, method) { if (_.includes(methods, method)) { - // Should be wrapped. + // no-op. assert.equal(someObject[method], innerWrapper); } else { - // Should not be wrapped. + // no-op assert.equal(someObject[method], fn); } }); @@ -968,13 +970,13 @@ QUnit.module('util', function(hooks) { var someObject = { someFunction: function() { - + // no-op. } }; var methods = ['someFunction']; var wrapper = 'someWrapper'; - var innerWrapper = function() { }; + var innerWrapper = function() { /* no-op */ }; joint.util.wrappers[wrapper] = function() { @@ -986,10 +988,10 @@ QUnit.module('util', function(hooks) { _.each(someObject, function(fn, method) { if (_.includes(methods, method)) { - // Should be wrapped. + // no-op. assert.equal(someObject[method], innerWrapper); } else { - // Should not be wrapped. + // no-op assert.equal(someObject[method], fn); } }); @@ -1597,7 +1599,7 @@ QUnit.module('util', function(hooks) { assert.deepEqual(actual, expected); }); - + QUnit.test('should return the difference of multiple values', function(assert) { const expected = { b: 2, c: 3 }; const actual = joint.util.objectDifference({ a: 1, b: 2, c: 3 }, { a: 1 }); @@ -1624,7 +1626,7 @@ QUnit.module('util', function(hooks) { } } } - }, + }, { a: { b: { @@ -1671,7 +1673,7 @@ QUnit.module('util', function(hooks) { } }, x: 'y' - }, + }, { a: { b: { diff --git a/packages/joint-core/test/jointjs/index.html b/packages/joint-core/test/jointjs/index.html index 8db633402..fcefd33ba 100644 --- a/packages/joint-core/test/jointjs/index.html +++ b/packages/joint-core/test/jointjs/index.html @@ -1,5 +1,5 @@ - + JointJS test suite diff --git a/packages/joint-core/test/jointjs/mvc.collection.js b/packages/joint-core/test/jointjs/mvc.collection.js index 113d9553e..4e09ab8dd 100644 --- a/packages/joint-core/test/jointjs/mvc.collection.js +++ b/packages/joint-core/test/jointjs/mvc.collection.js @@ -996,7 +996,9 @@ QUnit.module('joint.mvc.Collection', function(hooks) { QUnit.test('Attach options to collection.', function(assert) { assert.expect(2); var Model = joint.mvc.Model; - var comparator = function(){}; + var comparator = function(){ + // Do nothing. + }; var collection = new joint.mvc.Collection([], { model: Model, diff --git a/packages/joint-core/test/jointjs/mvc.events.js b/packages/joint-core/test/jointjs/mvc.events.js index 7996cb5bd..c318e6f74 100644 --- a/packages/joint-core/test/jointjs/mvc.events.js +++ b/packages/joint-core/test/jointjs/mvc.events.js @@ -17,51 +17,51 @@ QUnit.module('joint.mvc.Events', function(hooks) { obj.trigger('event'); assert.equal(obj.counter, 5, 'counter should be incremented five times.'); }); - + QUnit.test('binding and triggering multiple events', function(assert) { assert.expect(4); var obj = { counter: 0 }; _.extend(obj, joint.mvc.Events); - + obj.on('a b c', function() { obj.counter += 1; }); - + obj.trigger('a'); assert.equal(obj.counter, 1); - + obj.trigger('a b'); assert.equal(obj.counter, 3); - + obj.trigger('c'); assert.equal(obj.counter, 4); - + obj.off('a c'); obj.trigger('a b c'); assert.equal(obj.counter, 5); }); - + QUnit.test('binding and triggering with event maps', function(assert) { var obj = { counter: 0 }; _.extend(obj, joint.mvc.Events); - + var increment = function() { this.counter += 1; }; - + obj.on({ a: increment, b: increment, c: increment }, obj); - + obj.trigger('a'); assert.equal(obj.counter, 1); - + obj.trigger('a b'); assert.equal(obj.counter, 3); - + obj.trigger('c'); assert.equal(obj.counter, 4); - + obj.off({ a: increment, c: increment @@ -69,54 +69,54 @@ QUnit.module('joint.mvc.Events', function(hooks) { obj.trigger('a b c'); assert.equal(obj.counter, 5); }); - + QUnit.test('binding and triggering multiple event names with event maps', function(assert) { var obj = { counter: 0 }; _.extend(obj, joint.mvc.Events); - + var increment = function() { this.counter += 1; }; - + obj.on({ 'a b c': increment }); - + obj.trigger('a'); assert.equal(obj.counter, 1); - + obj.trigger('a b'); assert.equal(obj.counter, 3); - + obj.trigger('c'); assert.equal(obj.counter, 4); - + obj.off({ 'a c': increment }); obj.trigger('a b c'); assert.equal(obj.counter, 5); }); - + QUnit.test('binding and trigger with event maps context', function(assert) { assert.expect(2); var obj = { counter: 0 }; var context = {}; _.extend(obj, joint.mvc.Events); - + obj.on({ a: function() { assert.strictEqual(this, context, 'defaults `context` to `callback` param'); } }, context).trigger('a'); - + obj.off().on({ a: function() { assert.strictEqual(this, context, 'will not override explicit `context` param'); } }, this, context).trigger('a'); }); - + QUnit.test('listenTo and stopListening', function(assert) { assert.expect(1); var a = _.extend({}, joint.mvc.Events); @@ -127,7 +127,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { a.stopListening(); b.trigger('anything'); }); - + QUnit.test('listenTo and stopListening with event maps', function(assert) { assert.expect(4); var a = _.extend({}, joint.mvc.Events); @@ -142,7 +142,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { a.stopListening(); b.trigger('event event2'); }); - + QUnit.test('stopListening with omitted args', function(assert) { assert.expect(2); var a = _.extend({}, joint.mvc.Events); @@ -159,7 +159,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { a.stopListening(); b.trigger('event2'); }); - + QUnit.test('listenToOnce', function(assert) { assert.expect(2); // Same as the previous test, but we use once rather than having to explicitly unbind @@ -173,7 +173,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.'); assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.'); }); - + QUnit.test('listenToOnce and stopListening', function(assert) { assert.expect(1); var a = _.extend({}, joint.mvc.Events); @@ -185,7 +185,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { a.stopListening(); b.trigger('anything'); }); - + QUnit.test('listenTo, listenToOnce and stopListening', function(assert) { assert.expect(1); var a = _.extend({}, joint.mvc.Events); @@ -197,7 +197,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { a.stopListening(); b.trigger('anything'); }); - + QUnit.test('listenTo and stopListening with event maps', function(assert) { assert.expect(1); var a = _.extend({}, joint.mvc.Events); @@ -208,14 +208,14 @@ QUnit.module('joint.mvc.Events', function(hooks) { a.stopListening(); b.trigger('change'); }); - + QUnit.test('listenTo yourself', function(assert) { assert.expect(1); var e = _.extend({}, joint.mvc.Events); e.listenTo(e, 'foo', function(){ assert.ok(true); }); e.trigger('foo'); }); - + QUnit.test('listenTo yourself cleans yourself up with stopListening', function(assert) { assert.expect(1); var e = _.extend({}, joint.mvc.Events); @@ -224,12 +224,12 @@ QUnit.module('joint.mvc.Events', function(hooks) { e.stopListening(); e.trigger('foo'); }); - + QUnit.test('stopListening cleans up references', function(assert) { assert.expect(12); var a = _.extend({}, joint.mvc.Events); var b = _.extend({}, joint.mvc.Events); - var fn = function() {}; + var fn = function() { /* no-op */ }; b.on('event', fn); a.listenTo(b, 'event', fn).stopListening(); assert.equal(_.size(a._listeningTo), 0); @@ -248,12 +248,12 @@ QUnit.module('joint.mvc.Events', function(hooks) { assert.equal(_.size(b._events.event), 1); assert.equal(_.size(b._listeners), 0); }); - + QUnit.test('stopListening cleans up references from listenToOnce', function(assert) { assert.expect(12); var a = _.extend({}, joint.mvc.Events); var b = _.extend({}, joint.mvc.Events); - var fn = function() {}; + var fn = function() { /* no-op */ }; b.on('event', fn); a.listenToOnce(b, 'event', fn).stopListening(); assert.equal(_.size(a._listeningTo), 0); @@ -272,12 +272,12 @@ QUnit.module('joint.mvc.Events', function(hooks) { assert.equal(_.size(b._events.event), 1); assert.equal(_.size(b._listeners), 0); }); - + QUnit.test('listenTo and off cleaning up references', function(assert) { assert.expect(8); var a = _.extend({}, joint.mvc.Events); var b = _.extend({}, joint.mvc.Events); - var fn = function() {}; + var fn = function() { /* no-op */ }; a.listenTo(b, 'event', fn); b.off(); assert.equal(_.size(a._listeningTo), 0); @@ -295,7 +295,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { assert.equal(_.size(a._listeningTo), 0); assert.equal(_.size(b._listeners), 0); }); - + QUnit.test('listenTo and stopListening cleaning up references', function(assert) { assert.expect(2); var a = _.extend({}, joint.mvc.Events); @@ -307,7 +307,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { a.stopListening(b, 'all'); assert.equal(_.size(a._listeningTo), 0); }); - + QUnit.test('listenToOnce without context cleans up references after the event has fired', function(assert) { assert.expect(2); var a = _.extend({}, joint.mvc.Events); @@ -316,7 +316,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { b.trigger('anything'); assert.equal(_.size(a._listeningTo), 0); }); - + QUnit.test('listenToOnce with event maps cleans up references', function(assert) { assert.expect(2); var a = _.extend({}, joint.mvc.Events); @@ -328,7 +328,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { b.trigger('one'); assert.equal(_.size(a._listeningTo), 1); }); - + QUnit.test('listenToOnce with event maps binds the correct `this`', function(assert) { assert.expect(1); var a = _.extend({}, joint.mvc.Events); @@ -339,7 +339,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { }); b.trigger('one'); }); - + QUnit.test('listenTo with empty callback doesn\'t throw an error', function(assert) { assert.expect(1); var e = _.extend({}, joint.mvc.Events); @@ -347,7 +347,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { e.trigger('foo'); assert.ok(true); }); - + QUnit.test('trigger all for each event', function(assert) { assert.expect(3); var a, b, obj = { counter: 0 }; @@ -362,7 +362,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { assert.ok(b); assert.equal(obj.counter, 2); }); - + QUnit.test('on, then unbind all functions', function(assert) { assert.expect(1); var obj = { counter: 0 }; @@ -374,7 +374,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { obj.trigger('event'); assert.equal(obj.counter, 1, 'counter should have only been incremented once.'); }); - + QUnit.test('bind two callbacks, unbind only one', function(assert) { assert.expect(2); var obj = { counterA: 0, counterB: 0 }; @@ -388,7 +388,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.'); assert.equal(obj.counterB, 2, 'counterB should have been incremented twice.'); }); - + QUnit.test('unbind a callback in the midst of it firing', function(assert) { assert.expect(1); var obj = { counter: 0 }; @@ -403,7 +403,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { obj.trigger('event'); assert.equal(obj.counter, 1, 'the callback should have been unbound.'); }); - + QUnit.test('two binds that unbind themeselves', function(assert) { assert.expect(2); var obj = { counterA: 0, counterB: 0 }; @@ -418,7 +418,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.'); assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.'); }); - + QUnit.test('bind a callback with a default context when none supplied', function(assert) { assert.expect(1); var obj = _.extend({ @@ -426,11 +426,11 @@ QUnit.module('joint.mvc.Events', function(hooks) { assert.equal(this, obj, '`this` was bound to the callback'); } }, joint.mvc.Events); - + obj.once('event', obj.assertTrue); obj.trigger('event'); }); - + QUnit.test('bind a callback with a supplied context', function(assert) { assert.expect(1); var TestClass = function() { @@ -439,12 +439,12 @@ QUnit.module('joint.mvc.Events', function(hooks) { TestClass.prototype.assertTrue = function() { assert.ok(true, '`this` was bound to the callback'); }; - + var obj = _.extend({}, joint.mvc.Events); obj.on('event', function() { this.assertTrue(); }, new TestClass); obj.trigger('event'); }); - + QUnit.test('nested trigger with unbind', function(assert) { assert.expect(1); var obj = { counter: 0 }; @@ -456,21 +456,21 @@ QUnit.module('joint.mvc.Events', function(hooks) { obj.trigger('event'); assert.equal(obj.counter, 3, 'counter should have been incremented three times'); }); - + QUnit.test('callback list is not altered during trigger', function(assert) { assert.expect(2); var counter = 0, obj = _.extend({}, joint.mvc.Events); var incr = function(){ counter++; }; var incrOn = function(){ obj.on('event all', incr); }; var incrOff = function(){ obj.off('event all', incr); }; - + obj.on('event all', incrOn).trigger('event'); assert.equal(counter, 0, 'on does not alter callback list'); - + obj.off().on('event', incrOff).on('event all', incr).trigger('event'); assert.equal(counter, 2, 'off does not alter callback list'); }); - + QUnit.test('#1282 - \'all\' callback list is retrieved after each event.', function(assert) { assert.expect(1); var counter = 0; @@ -482,12 +482,12 @@ QUnit.module('joint.mvc.Events', function(hooks) { .trigger('x y'); assert.strictEqual(counter, 2); }); - + QUnit.test('if no callback is provided, `on` is a noop', function(assert) { assert.expect(0); _.extend({}, joint.mvc.Events).on('test').trigger('test'); }); - + QUnit.test('if callback is truthy but not a function, `on` should throw an error just like jQuery', function(assert) { assert.expect(1); var view = _.extend({}, joint.mvc.Events).on('test', 'noop'); @@ -495,7 +495,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { view.trigger('test'); }); }); - + QUnit.test('remove all events for a specific context', function(assert) { assert.expect(4); var obj = _.extend({}, joint.mvc.Events); @@ -504,7 +504,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { obj.off(null, null, obj); obj.trigger('x y'); }); - + QUnit.test('remove all events for a specific callback', function(assert) { assert.expect(4); var obj = _.extend({}, joint.mvc.Events); @@ -515,7 +515,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { obj.off(null, fail); obj.trigger('x y'); }); - + QUnit.test('#1310 - off does not skip consecutive events', function(assert) { assert.expect(0); var obj = _.extend({}, joint.mvc.Events); @@ -524,7 +524,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { obj.off(null, null, obj); obj.trigger('event'); }); - + QUnit.test('once', function(assert) { assert.expect(2); // Same as the previous test, but we use once rather than having to explicitly unbind @@ -538,82 +538,82 @@ QUnit.module('joint.mvc.Events', function(hooks) { assert.equal(obj.counterA, 1, 'counterA should have only been incremented once.'); assert.equal(obj.counterB, 1, 'counterB should have only been incremented once.'); }); - + QUnit.test('once variant one', function(assert) { assert.expect(3); var f = function(){ assert.ok(true); }; - + var a = _.extend({}, joint.mvc.Events).once('event', f); var b = _.extend({}, joint.mvc.Events).on('event', f); - + a.trigger('event'); - + b.trigger('event'); b.trigger('event'); }); - + QUnit.test('once variant two', function(assert) { assert.expect(3); var f = function(){ assert.ok(true); }; var obj = _.extend({}, joint.mvc.Events); - + obj .once('event', f) .on('event', f) .trigger('event') .trigger('event'); }); - + QUnit.test('once with off', function(assert) { assert.expect(0); var f = function(){ assert.ok(true); }; var obj = _.extend({}, joint.mvc.Events); - + obj.once('event', f); obj.off('event', f); obj.trigger('event'); }); - + QUnit.test('once with event maps', function(assert) { var obj = { counter: 0 }; _.extend(obj, joint.mvc.Events); - + var increment = function() { this.counter += 1; }; - + obj.once({ a: increment, b: increment, c: increment }, obj); - + obj.trigger('a'); assert.equal(obj.counter, 1); - + obj.trigger('a b'); assert.equal(obj.counter, 2); - + obj.trigger('c'); assert.equal(obj.counter, 3); - + obj.trigger('a b c'); assert.equal(obj.counter, 3); }); - + QUnit.test('bind a callback with a supplied context using once with object notation', function(assert) { assert.expect(1); var obj = { counter: 0 }; var context = {}; _.extend(obj, joint.mvc.Events); - + obj.once({ a: function() { assert.strictEqual(this, context, 'defaults `context` to `callback` param'); } }, context).trigger('a'); }); - + QUnit.test('once with off only by context', function(assert) { assert.expect(0); var context = {}; @@ -622,51 +622,51 @@ QUnit.module('joint.mvc.Events', function(hooks) { obj.off(null, null, context); obj.trigger('event'); }); - + QUnit.test('once with asynchronous events', function(assert) { var done = assert.async(); assert.expect(1); var func = _.debounce(function() { assert.ok(true); done(); }, 50); var obj = _.extend({}, joint.mvc.Events).once('async', func); - + obj.trigger('async'); obj.trigger('async'); }); - + QUnit.test('once with multiple events.', function(assert) { assert.expect(2); var obj = _.extend({}, joint.mvc.Events); obj.once('x y', function() { assert.ok(true); }); obj.trigger('x y'); }); - + QUnit.test('Off during iteration with once.', function(assert) { assert.expect(2); var obj = _.extend({}, joint.mvc.Events); var f = function(){ this.off('event', f); }; obj.on('event', f); - obj.once('event', function(){}); + obj.once('event', function(){ /* no-op */ }); obj.on('event', function(){ assert.ok(true); }); - + obj.trigger('event'); obj.trigger('event'); }); - + QUnit.test('once without a callback is a noop', function(assert) { assert.expect(0); _.extend({}, joint.mvc.Events).once('event').trigger('event'); }); - + QUnit.test('listenToOnce without a callback is a noop', function(assert) { assert.expect(0); var obj = _.extend({}, joint.mvc.Events); obj.listenToOnce(obj, 'event').trigger('event'); }); - + QUnit.test('event functions are chainable', function(assert) { var obj = _.extend({}, joint.mvc.Events); var obj2 = _.extend({}, joint.mvc.Events); - var fn = function() {}; + var fn = function() { /* no-op */ }; assert.equal(obj, obj.trigger('noeventssetyet')); assert.equal(obj, obj.off('noeventssetyet')); assert.equal(obj, obj.stopListening('noeventssetyet')); @@ -679,7 +679,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { assert.equal(obj, obj.stopListening(obj2, 'a')); assert.equal(obj, obj.stopListening()); }); - + QUnit.test('#3448 - listenToOnce with space-separated events', function(assert) { assert.expect(2); var one = _.extend({}, joint.mvc.Events); @@ -691,7 +691,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { two.trigger('y', 2); two.trigger('y', 2); }); - + QUnit.test('#3611 - listenTo is compatible with non-joint.mvc event libraries', function(assert) { var obj = _.extend({}, joint.mvc.Events); var other = { @@ -703,11 +703,11 @@ QUnit.module('joint.mvc.Events', function(hooks) { this.events[name](); } }; - + obj.listenTo(other, 'test', function() { assert.ok(true); }); other.trigger('test'); }); - + QUnit.test('#3611 - stopListening is compatible with non-joint.mvc event libraries', function(assert) { var obj = _.extend({}, joint.mvc.Events); var other = { @@ -723,7 +723,7 @@ QUnit.module('joint.mvc.Events', function(hooks) { if (fn) fn(); } }; - + obj.listenTo(other, 'test', function() { assert.ok(false); }); obj.stopListening(other); other.trigger('test'); diff --git a/packages/joint-core/test/jointjs/mvc.model.js b/packages/joint-core/test/jointjs/mvc.model.js index c7adc42b0..dc1584ae7 100644 --- a/packages/joint-core/test/jointjs/mvc.model.js +++ b/packages/joint-core/test/jointjs/mvc.model.js @@ -7,9 +7,9 @@ QUnit.module('joint.mvc.Model', function(hooks) { url: function() { return '/collection'; } }); var doc, collection; - + QUnit.module('mvc.Model', { - + beforeEach: function(assert) { doc = new ProxyModel({ id: '1-the-tempest', @@ -20,9 +20,9 @@ QUnit.module('joint.mvc.Model', function(hooks) { collection = new Klass(); collection.add(doc); } - + }); - + QUnit.test('initialize', function(assert) { assert.expect(3); var Model = joint.mvc.Model.extend({ @@ -35,13 +35,13 @@ QUnit.module('joint.mvc.Model', function(hooks) { assert.equal(model.one, 1); assert.equal(model.collection, collection); }); - + QUnit.test('Object.prototype properties are overridden by attributes', function(assert) { assert.expect(1); var model = new joint.mvc.Model({ hasOwnProperty: true }); assert.equal(model.get('hasOwnProperty'), true); }); - + QUnit.test('initialize with attributes and options', function(assert) { assert.expect(1); var Model = joint.mvc.Model.extend({ @@ -52,11 +52,11 @@ QUnit.module('joint.mvc.Model', function(hooks) { var model = new Model({}, { one: 1 }); assert.equal(model.one, 1); }); - + QUnit.test('preinitialize', function(assert) { assert.expect(2); var Model = joint.mvc.Model.extend({ - + preinitialize: function() { this.one = 1; } @@ -65,11 +65,11 @@ QUnit.module('joint.mvc.Model', function(hooks) { assert.equal(model.one, 1); assert.equal(model.collection, collection); }); - + QUnit.test('preinitialize occurs before the model is set up', function(assert) { assert.expect(6); var Model = joint.mvc.Model.extend({ - + preinitialize: function() { assert.equal(this.collection, undefined); assert.equal(this.cid, undefined); @@ -81,7 +81,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { assert.equal(model.id, 'foo'); assert.notEqual(model.cid, undefined); }); - + QUnit.test('clone', function(assert) { assert.expect(10); var a = new joint.mvc.Model({ foo: 1, bar: 2, baz: 3 }); @@ -95,26 +95,26 @@ QUnit.module('joint.mvc.Model', function(hooks) { a.set({ foo: 100 }); assert.equal(a.get('foo'), 100); assert.equal(b.get('foo'), 1, 'Changing a parent attribute does not change the clone.'); - + var foo = new joint.mvc.Model({ p: 1 }); var bar = new joint.mvc.Model({ p: 2 }); bar.set(foo.clone().attributes, { unset: true }); assert.equal(foo.get('p'), 1); assert.equal(bar.get('p'), undefined); }); - + QUnit.test('get', function(assert) { assert.expect(2); assert.equal(doc.get('title'), 'The Tempest'); assert.equal(doc.get('author'), 'Bill Shakespeare'); }); - + QUnit.test('has', function(assert) { assert.expect(10); var model = new joint.mvc.Model(); - + assert.strictEqual(model.has('name'), false); - + model.set({ '0': 0, '1': 1, @@ -125,21 +125,21 @@ QUnit.module('joint.mvc.Model', function(hooks) { 'null': null, 'undefined': undefined }); - + assert.strictEqual(model.has('0'), true); assert.strictEqual(model.has('1'), true); assert.strictEqual(model.has('true'), true); assert.strictEqual(model.has('false'), true); assert.strictEqual(model.has('empty'), true); assert.strictEqual(model.has('name'), true); - + model.unset('name'); - + assert.strictEqual(model.has('name'), false); assert.strictEqual(model.has('null'), false); assert.strictEqual(model.has('undefined'), false); }); - + QUnit.test('set and unset', function(assert) { assert.expect(8); var a = new joint.mvc.Model({ id: 'id', foo: 1, bar: 2, baz: 3 }); @@ -152,7 +152,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { a.set({ foo: 2 }); assert.equal(a.get('foo'), 2, 'Foo should NOT have changed, still 2'); assert.equal(changeCount, 1, 'Change count should NOT have incremented.'); - + a.validate = function(attrs) { assert.equal(attrs.foo, void 0, 'validate:true passed while unsetting'); }; @@ -160,11 +160,11 @@ QUnit.module('joint.mvc.Model', function(hooks) { assert.equal(a.get('foo'), void 0, 'Foo should have changed'); delete a.validate; assert.equal(changeCount, 2, 'Change count should have incremented for unset.'); - + a.unset('id'); assert.equal(a.id, undefined, 'Unsetting the id should remove the id property.'); }); - + QUnit.test('#2030 - set with failed validate, followed by another set triggers change', function(assert) { var attr = 0, main = 0, error = 0; var Model = joint.mvc.Model.extend({ @@ -182,7 +182,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ x: 1 }, { validate: true }); assert.deepEqual([attr, main, error], [1, 1, 1]); }); - + QUnit.test('set triggers changes in the correct order', function(assert) { var value = null; var model = new joint.mvc.Model; @@ -192,7 +192,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.trigger('last'); assert.equal(value, 'last'); }); - + QUnit.test('set falsy values in the correct order', function(assert) { assert.expect(2); var model = new joint.mvc.Model({ result: 'result' }); @@ -205,7 +205,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ result: false }, { silent: true }); model.set({ result: void 0 }); }); - + QUnit.test('nested set triggers with the correct options', function(assert) { var model = new joint.mvc.Model(); var o1 = {}; @@ -225,7 +225,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { }); model.set('a', 1, o1); }); - + QUnit.test('multiple unsets', function(assert) { assert.expect(1); var i = 0; @@ -237,7 +237,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.unset('a'); assert.equal(i, 2, 'Unset does not fire an event for missing attributes.'); }); - + QUnit.test('unset and changedAttributes', function(assert) { assert.expect(1); var model = new joint.mvc.Model({ a: 1 }); @@ -246,24 +246,24 @@ QUnit.module('joint.mvc.Model', function(hooks) { }); model.unset('a'); }); - + QUnit.test('setting an alternative cid prefix', function(assert) { assert.expect(4); var Model = joint.mvc.Model.extend({ cidPrefix: 'm' }); var model = new Model(); - + assert.equal(model.cid.charAt(0), 'm'); - + model = new joint.mvc.Model(); assert.equal(model.cid.charAt(0), 'c'); - + var Collection = joint.mvc.Collection.extend({ model: Model }); var col = new Collection([{ id: 'c5' }, { id: 'c6' }, { id: 'c7' }]); - + assert.equal(col.get('c6').cid.charAt(0), 'm'); col.set([{ id: 'c6', value: 'test' }], { merge: true, @@ -272,14 +272,14 @@ QUnit.module('joint.mvc.Model', function(hooks) { }); assert.ok(col.get('c6').has('value')); }); - + QUnit.test('set an empty string', function(assert) { assert.expect(1); var model = new joint.mvc.Model({ name: 'Model' }); model.set({ name: '' }); assert.equal(model.get('name'), ''); }); - + QUnit.test('setting an object', function(assert) { assert.expect(1); var model = new joint.mvc.Model({ @@ -295,7 +295,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { custom: { foo: 2 } // change event should be fired }); }); - + QUnit.test('clear', function(assert) { assert.expect(3); var changed; @@ -309,7 +309,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { assert.equal(changed, true); assert.equal(model.get('name'), undefined); }); - + QUnit.test('defaults', function(assert) { assert.expect(9); var Defaulted = joint.mvc.Model.extend({ @@ -345,7 +345,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model = new Defaulted({ hasOwnProperty: false }); assert.equal(model.get('hasOwnProperty'), false); }); - + QUnit.test('change, hasChanged, changedAttributes, previous, previousAttributes', function(assert) { assert.expect(9); var model = new joint.mvc.Model({ name: 'Tim', age: 10 }); @@ -362,7 +362,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ name: 'Rob' }); assert.equal(model.get('name'), 'Rob'); }); - + QUnit.test('changedAttributes', function(assert) { assert.expect(3); var model = new joint.mvc.Model({ a: 'a', b: 'b' }); @@ -370,7 +370,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { assert.equal(model.changedAttributes({ a: 'a' }), false); assert.equal(model.changedAttributes({ a: 'b' }).a, 'b'); }); - + QUnit.test('change with options', function(assert) { assert.expect(2); var value; @@ -383,7 +383,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ name: 'Sue' }, { prefix: 'Ms. ' }); assert.equal(value, 'Ms. Sue'); }); - + QUnit.test('change after initialize', function(assert) { assert.expect(1); var changed = 0; @@ -414,7 +414,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { assert.equal(result, false); assert.equal(model.get('a'), 100); }); - + QUnit.test('validate on unset and clear', function(assert) { assert.expect(6); var error; @@ -437,7 +437,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.clear(); assert.equal(model.get('name'), undefined); }); - + QUnit.test('validate with error callback', function(assert) { assert.expect(8); var lastError, boundError; @@ -459,7 +459,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { assert.equal(model.validationError, 'Can\'t change admin status.'); assert.equal(boundError, true); }); - + QUnit.test('defaults always extend attrs (#459)', function(assert) { assert.expect(2); var Defaulted = joint.mvc.Model.extend({ @@ -471,32 +471,32 @@ QUnit.module('joint.mvc.Model', function(hooks) { var providedattrs = new Defaulted({}); var emptyattrs = new Defaulted(); }); - + QUnit.test('Inherit class properties', function(assert) { assert.expect(6); var Parent = joint.mvc.Model.extend({ - instancePropSame: function() {}, - instancePropDiff: function() {} + instancePropSame: function() { /* no-op */ }, + instancePropDiff: function() { /* no-op */ } }, { - classProp: function() {} + classProp: function() { /* no-op */ } }); var Child = Parent.extend({ - instancePropDiff: function() {} + instancePropDiff: function() { /* no-op */ } }); - + var adult = new Parent; var kid = new Child; - + assert.equal(Child.classProp, Parent.classProp); assert.notEqual(Child.classProp, undefined); - + assert.equal(kid.instancePropSame, adult.instancePropSame); assert.notEqual(kid.instancePropSame, undefined); - + assert.notEqual(Child.prototype.instancePropDiff, Parent.prototype.instancePropDiff); assert.notEqual(Child.prototype.instancePropDiff, undefined); }); - + QUnit.test('Nested change events don\'t clobber previous attributes', function(assert) { assert.expect(4); new joint.mvc.Model() @@ -512,7 +512,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { }) .set({ state: 'hello' }); }); - + QUnit.test('hasChanged/set should use same comparison', function(assert) { assert.expect(2); var changed = 0, model = new joint.mvc.Model({ a: null }); @@ -525,31 +525,31 @@ QUnit.module('joint.mvc.Model', function(hooks) { .set({ a: undefined }); assert.equal(changed, 1); }); - + QUnit.test('#582, #425, change:attribute callbacks should fire after all changes have occurred', function(assert) { assert.expect(9); var model = new joint.mvc.Model; - + var assertion = function() { assert.equal(model.get('a'), 'a'); assert.equal(model.get('b'), 'b'); assert.equal(model.get('c'), 'c'); }; - + model.on('change:a', assertion); model.on('change:b', assertion); model.on('change:c', assertion); - + model.set({ a: 'a', b: 'b', c: 'c' }); }); - + QUnit.test('#871, set with attributes property', function(assert) { assert.expect(1); var model = new joint.mvc.Model(); model.set({ attributes: true }); assert.ok(model.has('attributes')); }); - + QUnit.test('set value regardless of equality/change', function(assert) { assert.expect(1); var model = new joint.mvc.Model({ x: [] }); @@ -557,7 +557,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ x: a }); assert.ok(model.get('x') === a); }); - + QUnit.test('set same value does not trigger change', function(assert) { assert.expect(0); var model = new joint.mvc.Model({ x: 1 }); @@ -565,20 +565,20 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ x: 1 }); model.set({ x: 1 }); }); - + QUnit.test('unset does not fire a change for undefined attributes', function(assert) { assert.expect(0); var model = new joint.mvc.Model({ x: undefined }); model.on('change:x', function(){ assert.ok(false); }); model.unset('x'); }); - + QUnit.test('set: undefined values', function(assert) { assert.expect(1); var model = new joint.mvc.Model({ x: undefined }); assert.ok('x' in model.attributes); }); - + QUnit.test('hasChanged works outside of change events, and true within', function(assert) { assert.expect(6); var model = new joint.mvc.Model({ x: 1 }); @@ -593,7 +593,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { assert.ok(model.hasChanged()); assert.equal(model.hasChanged('x'), true); }); - + QUnit.test('hasChanged gets cleared on the following set', function(assert) { assert.expect(4); var model = new joint.mvc.Model; @@ -606,14 +606,14 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({}); assert.ok(!model.hasChanged()); }); - + QUnit.test('`hasChanged` for falsey keys', function(assert) { assert.expect(1); var model = new joint.mvc.Model(); model.set({ x: true }, { silent: true }); assert.ok(!model.hasChanged('')); }); - + QUnit.test('`previous` for falsey keys', function(assert) { assert.expect(2); var model = new joint.mvc.Model({ '0': true, '': true }); @@ -639,7 +639,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ z: true }); assert.deepEqual(events, []); }); - + QUnit.test('nested `change` only fires once', function(assert) { assert.expect(1); var model = new joint.mvc.Model(); @@ -649,7 +649,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { }); model.set({ x: true }); }); - + QUnit.test('nested `set` during `\'change\'`', function(assert) { assert.expect(6); var count = 0; @@ -676,7 +676,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { }); model.set({ x: true }); }); - + QUnit.test('nested `change` with silent', function(assert) { assert.expect(3); var count = 0; @@ -702,7 +702,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ x: true }); model.set({ z: false }); }); - + QUnit.test('nested `change:attr` with silent', function(assert) { assert.expect(0); var model = new joint.mvc.Model(); @@ -713,7 +713,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { }); model.set({ x: true }); }); - + QUnit.test('multiple nested changes with silent', function(assert) { assert.expect(1); var model = new joint.mvc.Model(); @@ -726,7 +726,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { }); model.set({ x: true }); }); - + QUnit.test('multiple nested changes with silent', function(assert) { assert.expect(1); var changes = []; @@ -738,7 +738,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ b: 0 }); assert.deepEqual(changes, [0, 1]); }); - + QUnit.test('basic silent change semantics', function(assert) { assert.expect(1); var model = new joint.mvc.Model; @@ -747,7 +747,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ x: 2 }, { silent: true }); model.set({ x: 1 }); }); - + QUnit.test('nested set multiple times', function(assert) { assert.expect(1); var model = new joint.mvc.Model(); @@ -760,7 +760,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { }); model.set({ a: true }); }); - + QUnit.test('#1122 - clear does not alter options.', function(assert) { assert.expect(1); var model = new joint.mvc.Model(); @@ -768,7 +768,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.clear(options); assert.ok(!options.unset); }); - + QUnit.test('#1122 - unset does not alter options.', function(assert) { assert.expect(1); var model = new joint.mvc.Model(); @@ -776,7 +776,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.unset('x', options); assert.ok(!options.unset); }); - + QUnit.test('#1545 - `undefined` can be passed to a model constructor without coersion', function(assert) { var Model = joint.mvc.Model.extend({ defaults: { one: 1 }, @@ -787,7 +787,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { var emptyattrs = new Model(); var undefinedattrs = new Model(undefined); }); - + QUnit.test('#1664 - Changing from one value, silently to another, back to original triggers a change.', function(assert) { assert.expect(1); var model = new joint.mvc.Model({ x: 1 }); @@ -796,7 +796,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ x: 3 }, { silent: true }); model.set({ x: 1 }); }); - + QUnit.test('#1664 - multiple silent changes nested inside a change event', function(assert) { assert.expect(2); var changes = []; @@ -811,7 +811,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { assert.deepEqual(changes, ['a', 1, 'item']); assert.deepEqual(model.attributes, { a: 'c', b: 2 }); }); - + QUnit.test('#1791 - `attributes` is available for `parse`', function(assert) { var Model = joint.mvc.Model.extend({ parse: function() { this.has('a'); } // shouldn't throw an error @@ -819,7 +819,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { var model = new Model(null, { parse: true }); assert.expect(0); }); - + QUnit.test('silent changes in last `change` event back to original triggers change', function(assert) { assert.expect(2); var changes = []; @@ -833,13 +833,13 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.set({ a: 'a' }); assert.deepEqual(changes, ['a', 'a']); }); - + QUnit.test('#1943 change calculations should use _.isEqual', function(assert) { var model = new joint.mvc.Model({ a: { key: 'value' }}); model.set('a', { key: 'value' }, { silent: true }); assert.equal(model.changedAttributes(), false); }); - + QUnit.test('#1964 - final `change` event is always fired, regardless of interim changes', function(assert) { assert.expect(1); var model = new joint.mvc.Model(); @@ -851,7 +851,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { }); model.set('property', 'foo'); }); - + QUnit.test('isValid', function(assert) { var model = new joint.mvc.Model({ valid: true }); model.validate = function(attrs) { @@ -871,7 +871,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { model.validate = null; assert.ok(model.isValid()); }); - + QUnit.test('#1961 - Creating a model with {validate:true} will call validate and use the error callback', function(assert) { var Model = joint.mvc.Model.extend({ validate: function(attrs) { @@ -881,7 +881,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { var model = new Model({ id: 1 }, { validate: true }); assert.equal(model.validationError, 'This shouldn\'t happen'); }); - + QUnit.test('#2034 - nested set with silent only triggers one change', function(assert) { assert.expect(1); var model = new joint.mvc.Model(); @@ -891,7 +891,7 @@ QUnit.module('joint.mvc.Model', function(hooks) { }); model.set({ a: true }); }); - + QUnit.test('#3778 - id will only be updated if it is set', function(assert) { assert.expect(2); var model = new joint.mvc.Model({ id: 1 }); diff --git a/packages/joint-core/test/jointjs/mvc.view.js b/packages/joint-core/test/jointjs/mvc.view.js index c17760b65..c925bc874 100644 --- a/packages/joint-core/test/jointjs/mvc.view.js +++ b/packages/joint-core/test/jointjs/mvc.view.js @@ -39,7 +39,7 @@ QUnit.module('joint.mvc.View', function(hooks) { var SVGView = joint.mvc.View.extend({ svgElement: true, tagName: 'g', - setTheme: function() {} + setTheme: function() { /* no-op */ } }); var svgView = new SVGView; diff --git a/packages/joint-core/test/jointjs/paper.js b/packages/joint-core/test/jointjs/paper.js index dda023b05..4f8a5df08 100644 --- a/packages/joint-core/test/jointjs/paper.js +++ b/packages/joint-core/test/jointjs/paper.js @@ -259,7 +259,7 @@ QUnit.module('paper', function(hooks) { QUnit.module('paper.getRestrictedArea()', function() { QUnit.test('function', function(assert) { - var constraintPoint = function() {}; + var constraintPoint = function() { /* no-op */ }; var spy = sinon.spy(function() { return constraintPoint; }); this.paper.options.restrictTranslate = spy; assert.equal(this.paper.getRestrictedArea(1,2,3), constraintPoint); @@ -946,7 +946,7 @@ QUnit.module('paper', function(hooks) { this.paper.options.linkPinning = true; source.attr('.', { magnet: true }); data = {}; - sourceView.dragMagnetStart({ currentTarget: sourceView.el, target: sourceView.el, type: 'mousedown', data: data, stopPropagation: () => {}, isPropagationStopped: () => false }, 150, 150); + sourceView.dragMagnetStart({ currentTarget: sourceView.el, target: sourceView.el, type: 'mousedown', data: data, stopPropagation: joint.util.noop, isPropagationStopped: () => false }, 150, 150); sourceView.pointermove({ type: 'mousemove', data: data }, 150, 400); newLink = _.reject(this.graph.getLinks(), { id: 'link' })[0]; diff --git a/packages/joint-core/test/jointjs/requirejs.html b/packages/joint-core/test/jointjs/requirejs.html index 9bd6ace03..7057aa5cb 100644 --- a/packages/joint-core/test/jointjs/requirejs.html +++ b/packages/joint-core/test/jointjs/requirejs.html @@ -1,5 +1,5 @@ - + JointJS | require.js | test suite diff --git a/packages/joint-core/test/jointjs/utilHelpers.js b/packages/joint-core/test/jointjs/utilHelpers.js index 3e6bd33a4..920f754b9 100644 --- a/packages/joint-core/test/jointjs/utilHelpers.js +++ b/packages/joint-core/test/jointjs/utilHelpers.js @@ -574,7 +574,7 @@ QUnit.module('Lodash util helpers', function() { this.a = 1; } Foo.prototype.b = 1; - Foo.c = function() {}; + Foo.c = function() { /* no-op */ }; const map = new Map(); map.set('a', 1); @@ -819,7 +819,7 @@ QUnit.module('Lodash util helpers', function() { }); QUnit.test('should work with prototype objects', function(assert) { - function Foo() {} + function Foo() { /* empty constructor */ } Foo.prototype = { 'constructor': Foo }; assert.strictEqual(joint.util.isEmpty(Foo.prototype), true); @@ -856,14 +856,14 @@ QUnit.module('Lodash util helpers', function() { }); QUnit.test('should not treat objects with negative lengths as array-like', function(assert) { - function Foo() {} + function Foo() { /* empty constructor */ } Foo.prototype.length = -1; assert.strictEqual(joint.util.isEmpty(new Foo), true); }); QUnit.test('should not treat objects with lengths larger than `MAX_SAFE_INTEGER` as array-like', function(assert) { - function Foo() {} + function Foo() { /* empty constructor */ } Foo.prototype.length = Number.MAX_SAFE_INTEGER + 1; assert.strictEqual(joint.util.isEmpty(new Foo), true); @@ -1012,7 +1012,7 @@ QUnit.module('Lodash util helpers', function() { }); QUnit.test('should compare nested objects', function(assert) { - function noop() {} + function noop() { /* no-op */ } const object1 = { 'a': [1, 2, 3], @@ -1245,7 +1245,7 @@ QUnit.module('Lodash util helpers', function() { const object = { '0': 1, '1': 2, '2': 3 }; const args = toArgs([1, 2, 3]); - function Foo() {} + function Foo() { /* empty constructor */ } Foo.prototype = object; assert.strictEqual(joint.util.isEqual(args, object), true); @@ -2418,7 +2418,7 @@ QUnit.module('Lodash util helpers', function() { }); QUnit.test('should merge onto function `object` values', function(assert) { - function Foo() {} + function Foo() { /* empty constructor */ } const source = { 'a': 1 }; const actual = joint.util.merge(Foo, source); @@ -2428,7 +2428,7 @@ QUnit.module('Lodash util helpers', function() { }); QUnit.test('should merge first source object properties to function', function(assert) { - const fn = function() {}; + const fn = function() { /* no-op */ }; const object = { 'prop': {}}; const actual = joint.util.merge({ 'prop': fn }, object); @@ -2436,7 +2436,7 @@ QUnit.module('Lodash util helpers', function() { }); QUnit.test('should merge first and second source object properties to function', function(assert) { - const fn = function() {}; + const fn = function() { /* no-op */ }; const object = { 'prop': {}}; const actual = joint.util.merge({ 'prop': fn }, { 'prop': fn }, object); @@ -2444,7 +2444,7 @@ QUnit.module('Lodash util helpers', function() { }); QUnit.test('should not merge onto function values of sources', function(assert) { - const source1 = { 'a': function() {} }; + const source1 = { 'a': function() { /* no-op */ } }; const source2 = { 'a': { 'b': 2 }}; const expected = { 'a': { 'b': 2 }}; let actual = joint.util.merge({}, source1, source2); @@ -2457,7 +2457,7 @@ QUnit.module('Lodash util helpers', function() { }); QUnit.test('should merge onto non-plain `object` values', function(assert) { - function Foo() {} + function Foo() { /* empty constructor */ } const object = new Foo; const actual = joint.util.merge(object, { 'a': 1 }); @@ -2505,7 +2505,7 @@ QUnit.module('Lodash util helpers', function() { }); QUnit.test('should assign non array/buffer/typed-array/plain-object source values directly', function(assert) { - function Foo() {} + function Foo() { /* empty constructor */ } const values = [new Foo, new Boolean, new Date, Foo, new Number, new String, new RegExp]; const expected = values.map(() => true); @@ -2655,7 +2655,7 @@ QUnit.module('Lodash util helpers', function() { QUnit.module('merge with customizer (mergeWith)', function() { QUnit.test('should handle merging when `customizer` returns `undefined`', function(assert) { - let actual = joint.util.merge({ 'a': { 'b': [1, 1] }}, { 'a': { 'b': [0] }}, () => {}); + let actual = joint.util.merge({ 'a': { 'b': [1, 1] }}, { 'a': { 'b': [0] }}, () => { /* no-op */ }); assert.deepEqual(actual, { 'a': { 'b': [0, 1] }}); actual = joint.util.merge([], [undefined], (val) => val); @@ -2666,7 +2666,7 @@ QUnit.module('Lodash util helpers', function() { const source1 = { 'a': { 'b': { 'c': 1 }}}; const source2 = { 'a': { 'b': { 'd': 2 }}}; - joint.util.merge({}, source1, source2, () => {}); + joint.util.merge({}, source1, source2, () => { /* no-op */ }); assert.deepEqual(source1.a.b, { 'c': 1 }); }); diff --git a/packages/joint-core/test/jointjs/webpack.html b/packages/joint-core/test/jointjs/webpack.html index 44eb58614..02d59fef0 100644 --- a/packages/joint-core/test/jointjs/webpack.html +++ b/packages/joint-core/test/jointjs/webpack.html @@ -1,5 +1,5 @@ - + JointJS | Webpack | test suite diff --git a/packages/joint-core/test/vectorizer/index.html b/packages/joint-core/test/vectorizer/index.html index 898d8059e..4a8ce0f50 100644 --- a/packages/joint-core/test/vectorizer/index.html +++ b/packages/joint-core/test/vectorizer/index.html @@ -1,5 +1,5 @@ - + Vectorizer test suite diff --git a/packages/joint-core/test/vectorizer/requirejs.html b/packages/joint-core/test/vectorizer/requirejs.html index e97d68821..59f64aa8e 100644 --- a/packages/joint-core/test/vectorizer/requirejs.html +++ b/packages/joint-core/test/vectorizer/requirejs.html @@ -1,5 +1,5 @@ - + Vectorizer | require.js | test suite diff --git a/packages/joint-layout-directed-graph/test/index.html b/packages/joint-layout-directed-graph/test/index.html index 803744083..94a0a8eba 100644 --- a/packages/joint-layout-directed-graph/test/index.html +++ b/packages/joint-layout-directed-graph/test/index.html @@ -1,5 +1,5 @@ - + JointJS LayoutDirectedGraph test suite diff --git a/packages/joint-layout-directed-graph/test/requirejs/requirejs.html b/packages/joint-layout-directed-graph/test/requirejs/requirejs.html index 9ae4eeceb..569076ce0 100644 --- a/packages/joint-layout-directed-graph/test/requirejs/requirejs.html +++ b/packages/joint-layout-directed-graph/test/requirejs/requirejs.html @@ -1,5 +1,5 @@ - + JointJS LayoutDirectedGraph | require.js | test suite diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 000000000..0205ea3f3 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,4 @@ +sonar.projectKey=joint +sonar.exclusions=packages/joint-core/demo/chess/src/garbochess.js, packages/joint-core/src/polyfills/** +sonar.scm.provider=git +sonar.sources=.