npm update + fix linked to this update

found an issue with eslint when empty comments were used.
This commit is contained in:
jfh
2020-10-04 23:07:31 +02:00
parent e2493664ed
commit cfbb5a5ec8
15 changed files with 594 additions and 193 deletions

View File

@@ -38,7 +38,7 @@ describe('contextmenu', function () {
});
it('Test svgedit.contextmenu adds valid menu item', function () {
const validItem = {id: 'valid', label: 'anicelabel', action () { /* */ }};
const validItem = {id: 'valid', label: 'anicelabel', action () { /* empty fn */ }};
contextmenu.add(validItem);
assert.ok(contextmenu.hasCustomHandler('valid'), 'Valid menu item is added.');
@@ -46,8 +46,8 @@ describe('contextmenu', function () {
});
it('Test svgedit.contextmenu rejects valid duplicate menu item id', function () {
const validItem1 = {id: 'valid', label: 'anicelabel', action () { /**/ }};
const validItem2 = {id: 'valid', label: 'anicelabel', action () { /**/ }};
const validItem1 = {id: 'valid', label: 'anicelabel', action () { /* empty fn */ }};
const validItem2 = {id: 'valid', label: 'anicelabel', action () { /* empty fn */ }};
contextmenu.add(validItem1);
assert.throws(

View File

@@ -44,7 +44,7 @@ describe('draw.Drawing', function () {
const getCurrentDrawing = function () {
return currentDrawing_;
};
const setCurrentGroup = (cg) => { /* */ };
const setCurrentGroup = (cg) => { /* empty fn */ };
draw.init(
/**
* @implements {module:draw.DrawCanvasInit}
@@ -149,7 +149,7 @@ describe('draw.Drawing', function () {
assert.equal(typeof draw, typeof {});
assert.ok(draw.Drawing);
assert.equal(typeof draw.Drawing, typeof function () { /* */ });
assert.equal(typeof draw.Drawing, typeof function () { /* empty fn */ });
});
it('Test document creation', function () {
@@ -288,7 +288,7 @@ describe('draw.Drawing', function () {
it('Test getNumLayers', function () {
const drawing = new draw.Drawing(svg);
assert.equal(typeof drawing.getNumLayers, typeof function () { /* */ });
assert.equal(typeof drawing.getNumLayers, typeof function () { /* empty fn */ });
assert.equal(drawing.getNumLayers(), 0);
setupSVGWith3Layers(svg);
@@ -304,7 +304,7 @@ describe('draw.Drawing', function () {
const drawing = new draw.Drawing(svg);
drawing.identifyLayers();
assert.equal(typeof drawing.hasLayer, typeof function () { /* */ });
assert.equal(typeof drawing.hasLayer, typeof function () { /* empty fn */ });
assert.ok(!drawing.hasLayer('invalid-layer'));
assert.ok(drawing.hasLayer(LAYER3));
@@ -412,7 +412,7 @@ describe('draw.Drawing', function () {
drawing.identifyLayers();
assert.ok(drawing.getCurrentLayer);
assert.equal(typeof drawing.getCurrentLayer, typeof function () { /* */ });
assert.equal(typeof drawing.getCurrentLayer, typeof function () { /* empty fn */ });
assert.ok(drawing.getCurrentLayer());
assert.equal(drawing.getCurrentLayer(), drawing.all_layers[2].getGroup());
@@ -425,7 +425,7 @@ describe('draw.Drawing', function () {
drawing.identifyLayers();
assert.ok(drawing.setCurrentLayer);
assert.equal(typeof drawing.setCurrentLayer, typeof function () { /* */ });
assert.equal(typeof drawing.setCurrentLayer, typeof function () { /* empty fn */ });
drawing.setCurrentLayer(LAYER2);
assert.equal(drawing.getCurrentLayerName(), LAYER2);
@@ -451,7 +451,7 @@ describe('draw.Drawing', function () {
drawing.identifyLayers();
assert.ok(drawing.setCurrentLayerName);
assert.equal(typeof drawing.setCurrentLayerName, typeof function () { /* */ });
assert.equal(typeof drawing.setCurrentLayerName, typeof function () { /* empty fn */ });
const oldName = drawing.getCurrentLayerName();
const newName = 'New Name';
@@ -473,9 +473,9 @@ describe('draw.Drawing', function () {
it('Test createLayer()', function () {
const mockHrService = {
startBatchCommand () { /**/ },
endBatchCommand () { /**/ },
insertElement () { /**/ }
startBatchCommand () { /* empty fn */ },
endBatchCommand () { /* empty fn */ },
insertElement () { /* empty fn */ }
};
addOwnSpies(mockHrService);
@@ -484,7 +484,7 @@ describe('draw.Drawing', function () {
drawing.identifyLayers();
assert.ok(drawing.createLayer);
assert.equal(typeof drawing.createLayer, typeof function () { /* */ });
assert.equal(typeof drawing.createLayer, typeof function () { /* empty fn */ });
const NEW_LAYER_NAME = 'Layer A';
const layerG = drawing.createLayer(NEW_LAYER_NAME, mockHrService);
@@ -503,10 +503,10 @@ describe('draw.Drawing', function () {
it('Test mergeLayer()', function () {
const mockHrService = {
startBatchCommand () { /**/ },
endBatchCommand () { /**/ },
moveElement () { /**/ },
removeElement () { /**/ }
startBatchCommand () { /* empty fn */ },
endBatchCommand () { /* empty fn */ },
moveElement () { /* empty fn */ },
removeElement () { /* empty fn */ }
};
addOwnSpies(mockHrService);
@@ -519,7 +519,7 @@ describe('draw.Drawing', function () {
assert.equal(drawing.getCurrentLayer(), layers[2]);
assert.ok(drawing.mergeLayer);
assert.equal(typeof drawing.mergeLayer, typeof function () { /* */ });
assert.equal(typeof drawing.mergeLayer, typeof function () { /* empty fn */ });
drawing.mergeLayer(mockHrService);
@@ -540,10 +540,10 @@ describe('draw.Drawing', function () {
it('Test mergeLayer() when no previous layer to merge', function () {
const mockHrService = {
startBatchCommand () { /**/ },
endBatchCommand () { /**/ },
moveElement () { /**/ },
removeElement () { /**/ }
startBatchCommand () { /* empty fn */ },
endBatchCommand () { /* empty fn */ },
moveElement () { /* empty fn */ },
removeElement () { /* empty fn */ }
};
addOwnSpies(mockHrService);
@@ -573,10 +573,10 @@ describe('draw.Drawing', function () {
it('Test mergeAllLayers()', function () {
const mockHrService = {
startBatchCommand () { /**/ },
endBatchCommand () { /**/ },
moveElement () { /**/ },
removeElement () { /**/ }
startBatchCommand () { /* empty fn */ },
endBatchCommand () { /* empty fn */ },
moveElement () { /* empty fn */ },
removeElement () { /* empty fn */ }
};
addOwnSpies(mockHrService);
@@ -591,7 +591,7 @@ describe('draw.Drawing', function () {
drawing.identifyLayers();
assert.ok(drawing.mergeAllLayers);
assert.equal(typeof drawing.mergeAllLayers, typeof function () { /* */ });
assert.equal(typeof drawing.mergeAllLayers, typeof function () { /* empty fn */ });
drawing.mergeAllLayers(mockHrService);
@@ -616,9 +616,9 @@ describe('draw.Drawing', function () {
it('Test cloneLayer()', function () {
const mockHrService = {
startBatchCommand () { /**/ },
endBatchCommand () { /**/ },
insertElement () { /**/ }
startBatchCommand () { /* empty fn */ },
endBatchCommand () { /* empty fn */ },
insertElement () { /* empty fn */ }
};
addOwnSpies(mockHrService);
@@ -630,7 +630,7 @@ describe('draw.Drawing', function () {
drawing.identifyLayers();
assert.ok(drawing.cloneLayer);
assert.equal(typeof drawing.cloneLayer, typeof function () { /* */ });
assert.equal(typeof drawing.cloneLayer, typeof function () { /* empty fn */ });
const clone = drawing.cloneLayer('clone', mockHrService);
@@ -670,7 +670,7 @@ describe('draw.Drawing', function () {
drawing.identifyLayers();
assert.ok(drawing.getLayerVisibility);
assert.equal(typeof drawing.getLayerVisibility, typeof function () { /* */ });
assert.equal(typeof drawing.getLayerVisibility, typeof function () { /* empty fn */ });
assert.ok(drawing.getLayerVisibility(LAYER1));
assert.ok(drawing.getLayerVisibility(LAYER2));
assert.ok(drawing.getLayerVisibility(LAYER3));
@@ -684,7 +684,7 @@ describe('draw.Drawing', function () {
drawing.identifyLayers();
assert.ok(drawing.setLayerVisibility);
assert.equal(typeof drawing.setLayerVisibility, typeof function () { /* */ });
assert.equal(typeof drawing.setLayerVisibility, typeof function () { /* empty fn */ });
drawing.setLayerVisibility(LAYER3, false);
drawing.setLayerVisibility(LAYER2, true);
@@ -706,7 +706,7 @@ describe('draw.Drawing', function () {
drawing.identifyLayers();
assert.ok(drawing.getLayerOpacity);
assert.equal(typeof drawing.getLayerOpacity, typeof function () { /* */ });
assert.equal(typeof drawing.getLayerOpacity, typeof function () { /* empty fn */ });
assert.strictEqual(drawing.getLayerOpacity(LAYER1), 1.0);
assert.strictEqual(drawing.getLayerOpacity(LAYER2), 1.0);
assert.strictEqual(drawing.getLayerOpacity(LAYER3), 1.0);
@@ -720,7 +720,7 @@ describe('draw.Drawing', function () {
drawing.identifyLayers();
assert.ok(drawing.setLayerOpacity);
assert.equal(typeof drawing.setLayerOpacity, typeof function () { /* */ });
assert.equal(typeof drawing.setLayerOpacity, typeof function () { /* empty fn */ });
drawing.setLayerOpacity(LAYER1, 0.4);
drawing.setLayerOpacity(LAYER2, 'invalid-string');

View File

@@ -9,11 +9,11 @@ describe('history', function () {
// TODO(codedread): Write tests for handling history events.
// Mocked out methods.
transformlist.changeRemoveElementFromListMap((elem) => { /* */ });
transformlist.changeRemoveElementFromListMap((elem) => { /* empty fn */ });
utilities.mock({
getHref (elem) { return '#foo'; },
setHref (elem, val) { /* */ },
setHref (elem, val) { /* empty fn */ },
getRotationAngle (elem) { return 0; }
});
@@ -26,10 +26,10 @@ describe('history', function () {
this.text = optText;
}
apply (handler) {
super.apply(handler, () => { /* */ });
super.apply(handler, () => { /* empty fn */ });
}
unapply (handler) {
super.unapply(handler, () => { /* */ });
super.unapply(handler, () => { /* empty fn */ });
}
elements () { return []; } // eslint-disable-line class-methods-use-this
}
@@ -82,12 +82,12 @@ describe('history', function () {
assert.ok(hstory.RemoveElementCommand);
assert.ok(hstory.BatchCommand);
assert.ok(hstory.UndoManager);
assert.equal(typeof hstory.MoveElementCommand, typeof function () { /* */ });
assert.equal(typeof hstory.InsertElementCommand, typeof function () { /* */ });
assert.equal(typeof hstory.ChangeElementCommand, typeof function () { /* */ });
assert.equal(typeof hstory.RemoveElementCommand, typeof function () { /* */ });
assert.equal(typeof hstory.BatchCommand, typeof function () { /* */ });
assert.equal(typeof hstory.UndoManager, typeof function () { /* */ });
assert.equal(typeof hstory.MoveElementCommand, typeof function () { /* empty fn */ });
assert.equal(typeof hstory.InsertElementCommand, typeof function () { /* empty fn */ });
assert.equal(typeof hstory.ChangeElementCommand, typeof function () { /* empty fn */ });
assert.equal(typeof hstory.RemoveElementCommand, typeof function () { /* empty fn */ });
assert.equal(typeof hstory.BatchCommand, typeof function () { /* empty fn */ });
assert.equal(typeof hstory.UndoManager, typeof function () { /* empty fn */ });
});
it('Test UndoManager methods', function () {
@@ -100,12 +100,12 @@ describe('history', function () {
assert.ok(undoMgr.getNextRedoCommandText);
assert.equal(typeof undoMgr, typeof {});
assert.equal(typeof undoMgr.addCommandToHistory, typeof function () { /* */ });
assert.equal(typeof undoMgr.getUndoStackSize, typeof function () { /* */ });
assert.equal(typeof undoMgr.getRedoStackSize, typeof function () { /* */ });
assert.equal(typeof undoMgr.resetUndoStack, typeof function () { /* */ });
assert.equal(typeof undoMgr.getNextUndoCommandText, typeof function () { /* */ });
assert.equal(typeof undoMgr.getNextRedoCommandText, typeof function () { /* */ });
assert.equal(typeof undoMgr.addCommandToHistory, typeof function () { /* empty fn */ });
assert.equal(typeof undoMgr.getUndoStackSize, typeof function () { /* empty fn */ });
assert.equal(typeof undoMgr.getRedoStackSize, typeof function () { /* empty fn */ });
assert.equal(typeof undoMgr.resetUndoStack, typeof function () { /* empty fn */ });
assert.equal(typeof undoMgr.getNextUndoCommandText, typeof function () { /* empty fn */ });
assert.equal(typeof undoMgr.getNextRedoCommandText, typeof function () { /* empty fn */ });
});
it('Test UndoManager.addCommandToHistory() function', function () {
@@ -284,8 +284,8 @@ describe('history', function () {
let move = new hstory.MoveElementCommand(this.div3, this.div1, this.divparent);
assert.ok(move.unapply);
assert.ok(move.apply);
assert.equal(typeof move.unapply, typeof function () { /* */ });
assert.equal(typeof move.apply, typeof function () { /* */ });
assert.equal(typeof move.unapply, typeof function () { /* empty fn */ });
assert.equal(typeof move.apply, typeof function () { /* empty fn */ });
move.unapply();
assert.equal(this.divparent.firstElementChild, this.div3);
@@ -330,8 +330,8 @@ describe('history', function () {
let insert = new hstory.InsertElementCommand(this.div3);
assert.ok(insert.unapply);
assert.ok(insert.apply);
assert.equal(typeof insert.unapply, typeof function () { /* */ });
assert.equal(typeof insert.apply, typeof function () { /* */ });
assert.equal(typeof insert.unapply, typeof function () { /* empty fn */ });
assert.equal(typeof insert.apply, typeof function () { /* empty fn */ });
insert.unapply();
assert.equal(this.divparent.childElementCount, 2);
@@ -367,8 +367,8 @@ describe('history', function () {
let remove = new hstory.RemoveElementCommand(div6, null, this.divparent);
assert.ok(remove.unapply);
assert.ok(remove.apply);
assert.equal(typeof remove.unapply, typeof function () { /* */ });
assert.equal(typeof remove.apply, typeof function () { /* */ });
assert.equal(typeof remove.unapply, typeof function () { /* empty fn */ });
assert.equal(typeof remove.apply, typeof function () { /* empty fn */ });
remove.unapply();
assert.equal(this.divparent.childElementCount, 4);
@@ -405,8 +405,8 @@ describe('history', function () {
{title: 'old title', class: 'foo'});
assert.ok(change.unapply);
assert.ok(change.apply);
assert.equal(typeof change.unapply, typeof function () { /* */ });
assert.equal(typeof change.apply, typeof function () { /* */ });
assert.equal(typeof change.unapply, typeof function () { /* empty fn */ });
assert.equal(typeof change.apply, typeof function () { /* empty fn */ });
change.unapply();
assert.equal(this.div1.getAttribute('title'), 'old title');
@@ -476,8 +476,8 @@ describe('history', function () {
assert.ok(change.unapply);
assert.ok(change.apply);
assert.equal(typeof change.unapply, typeof function () { /* */ });
assert.equal(typeof change.apply, typeof function () { /* */ });
assert.equal(typeof change.unapply, typeof function () { /* empty fn */ });
assert.equal(typeof change.apply, typeof function () { /* empty fn */ });
change.unapply();
assert.equal(line.getAttribute('class'), 'oldClass');
@@ -511,13 +511,13 @@ describe('history', function () {
batch.apply();
assert.equal(concatResult, 'abc');
MockCommand.prototype.apply = function () { /* */ };
MockCommand.prototype.apply = function () { /* empty fn */ };
MockCommand.prototype.unapply = function () { concatResult += this.text; };
concatResult = '';
assert.ok(!concatResult);
batch.unapply();
assert.equal(concatResult, 'cba');
MockCommand.prototype.unapply = function () { /* */ };
MockCommand.prototype.unapply = function () { /* empty fn */ };
});
});

View File

@@ -11,9 +11,9 @@ describe('math', function () {
assert.ok(math.transformPoint);
assert.ok(math.isIdentity);
assert.ok(math.matrixMultiply);
assert.equal(typeof math.transformPoint, typeof function () { /* */ });
assert.equal(typeof math.isIdentity, typeof function () { /* */ });
assert.equal(typeof math.matrixMultiply, typeof function () { /* */ });
assert.equal(typeof math.transformPoint, typeof function () { /* empty fn */ });
assert.equal(typeof math.isIdentity, typeof function () { /* empty fn */ });
assert.equal(typeof math.matrixMultiply, typeof function () { /* empty fn */ });
});
it('Test svgedit.math.transformPoint() function', function () {

View File

@@ -54,7 +54,7 @@ describe('recalculate', function () {
{
getSVGRoot () { return svg; },
getStartTransform () { return ''; },
setStartTransform () { /* */ }
setStartTransform () { /* empty fn */ }
}
);
}

View File

@@ -81,10 +81,10 @@ describe('select', function () {
assert.ok(select.init);
assert.ok(select.getSelectorManager);
assert.equal(typeof select, typeof {});
assert.equal(typeof select.Selector, typeof function () { /* */ });
assert.equal(typeof select.SelectorManager, typeof function () { /* */ });
assert.equal(typeof select.init, typeof function () { /* */ });
assert.equal(typeof select.getSelectorManager, typeof function () { /* */ });
assert.equal(typeof select.Selector, typeof function () { /* empty fn */ });
assert.equal(typeof select.SelectorManager, typeof function () { /* empty fn */ });
assert.equal(typeof select.init, typeof function () { /* empty fn */ });
assert.equal(typeof select.getSelectorManager, typeof function () { /* empty fn */ });
});
it('Test Selector DOM structure', function () {

View File

@@ -73,7 +73,7 @@ describe('svgtransformlist', function () {
const t = svgcontent.createSVGTransform();
assert.ok(t);
assert.ok(rxform.initialize);
assert.equal(typeof rxform.initialize, typeof function () { /* */ });
assert.equal(typeof rxform.initialize, typeof function () { /* empty fn */ });
rxform.initialize(t);
assert.equal(rxform.numberOfItems, 1);
assert.equal(cxform.numberOfItems, 0);
@@ -96,8 +96,8 @@ describe('svgtransformlist', function () {
assert.ok(rxform.appendItem);
assert.ok(rxform.getItem);
assert.equal(typeof rxform.appendItem, typeof function () { /* */ });
assert.equal(typeof rxform.getItem, typeof function () { /* */ });
assert.equal(typeof rxform.appendItem, typeof function () { /* empty fn */ });
assert.equal(typeof rxform.getItem, typeof function () { /* empty fn */ });
rxform.appendItem(t1);
rxform.appendItem(t2);
@@ -127,7 +127,7 @@ describe('svgtransformlist', function () {
const t1 = svgcontent.createSVGTransform(),
t2 = svgcontent.createSVGTransform();
assert.ok(rxform.removeItem);
assert.equal(typeof rxform.removeItem, typeof function () { /* */ });
assert.equal(typeof rxform.removeItem, typeof function () { /* empty fn */ });
rxform.appendItem(t1);
rxform.appendItem(t2);
@@ -145,7 +145,7 @@ describe('svgtransformlist', function () {
const cxform = transformlist.getTransformList(circle);
assert.ok(rxform.replaceItem);
assert.equal(typeof rxform.replaceItem, typeof function () { /* */ });
assert.equal(typeof rxform.replaceItem, typeof function () { /* empty fn */ });
const t1 = svgcontent.createSVGTransform(),
t2 = svgcontent.createSVGTransform(),
@@ -177,7 +177,7 @@ describe('svgtransformlist', function () {
const cxform = transformlist.getTransformList(circle);
assert.ok(rxform.insertItemBefore);
assert.equal(typeof rxform.insertItemBefore, typeof function () { /* */ });
assert.equal(typeof rxform.insertItemBefore, typeof function () { /* empty fn */ });
const t1 = svgcontent.createSVGTransform(),
t2 = svgcontent.createSVGTransform(),

View File

@@ -49,7 +49,7 @@ describe('units', function () {
it('Test svgedit.units.shortFloat()', function () {
assert.ok(units.shortFloat);
assert.equal(typeof units.shortFloat, typeof function () { /* */ });
assert.equal(typeof units.shortFloat, typeof function () { /* empty fn */ });
const {shortFloat} = units;
assert.equal(shortFloat(0.00000001), 0);
@@ -61,7 +61,7 @@ describe('units', function () {
it('Test svgedit.units.isValidUnit()', function () {
assert.ok(units.isValidUnit);
assert.equal(typeof units.isValidUnit, typeof function () { /* */ });
assert.equal(typeof units.isValidUnit, typeof function () { /* empty fn */ });
const {isValidUnit} = units;
assert.ok(isValidUnit('0'));
@@ -85,7 +85,7 @@ describe('units', function () {
it('Test svgedit.units.convertUnit()', function () {
assert.ok(units.convertUnit);
assert.equal(typeof units.convertUnit, typeof function () { /* */ });
assert.equal(typeof units.convertUnit, typeof function () { /* empty fn */ });
// cm in default setup
assert.equal(units.convertUnit(42), 1.1113);
assert.equal(units.convertUnit(42, 'px'), 42);

View File

@@ -28,7 +28,7 @@ describe('utilities', function () {
svgroot.append(elem);
return elem;
}
const mockPathActions = {resetOrientation () { /* */ }};
const mockPathActions = {resetOrientation () { /* empty fn */ }};
let mockHistorySubCommands = [];
const mockHistory = {
BatchCommand: class {
@@ -101,7 +101,7 @@ describe('utilities', function () {
it('Test svgedit.utilities package', function () {
assert.ok(utilities);
assert.ok(utilities.toXml);
assert.equal(typeof utilities.toXml, typeof function () { /* */ });
assert.equal(typeof utilities.toXml, typeof function () { /* empty fn */ });
});
it('Test svgedit.utilities.toXml() function', function () {