- Docs (JSDoc): Further on preferring void

This commit is contained in:
Brett Zamir
2019-04-16 08:59:16 +08:00
parent 894fed3e80
commit d84f39cb3f
62 changed files with 576 additions and 575 deletions

View File

@@ -10,7 +10,7 @@ QUnit.log((details) => {
/**
* Tear down tests, resetting custom menus.
* @returns {undefined}
* @returns {void}
*/
function tearDown () {
contextmenu.resetCustomMenus();

View File

@@ -21,7 +21,7 @@ let elemId = 1;
/**
* Set up tests with mock data.
* @returns {undefined}
* @returns {void}
*/
function setUp () {
// Mock out editor context.
@@ -52,7 +52,7 @@ function setUp () {
/**
* Tear down tests, removing elements.
* @returns {undefined}
* @returns {void}
*/
function tearDown () {
while (svg.hasChildNodes()) {

View File

@@ -50,14 +50,14 @@ class MockHistoryEventHandler {
/**
* Set up tests (with undo manager).
* @returns {undefined}
* @returns {void}
*/
function setUp () {
undoMgr = new hstory.UndoManager();
}
/**
* Tear down tests, destroying undo manager.
* @returns {undefined}
* @returns {void}
*/
function tearDown () {
undoMgr = null;

View File

@@ -5,7 +5,7 @@ const NEAR_ZERO = 5e-6; // 0.000005, Firefox fails at higher levels of precision
* @param {Float} actual
* @param {Float} expected
* @param {string} message
* @returns {undefined}
* @returns {void}
*/
function almostEquals (actual, expected, message) {
message = message || (actual + ' did not equal ' + expected);

View File

@@ -8,7 +8,7 @@
* @param {Float} expected
* @param {Float} maxDifference (the maximum inclusive difference allowed between the actual and expected numbers)
* @param {string} [message] Defaults to structured message
* @returns {undefined}
* @returns {void}
*/
function close (actual, expected, maxDifference, message) {
const actualDiff = (actual === expected) ? 0 : Math.abs(actual - expected),
@@ -27,7 +27,7 @@ function close (actual, expected, maxDifference, message) {
* @param {Float} expected
* @param {Float} maxPercentDifference (the maximum inclusive difference percentage allowed between the actual and expected numbers)
* @param {string} [message] Defaults to a structured message
* @returns {undefined}
* @returns {void}
*/
function closePercent (actual, expected, maxPercentDifference, message) {
let actualDiff, result;
@@ -57,7 +57,7 @@ function closePercent (actual, expected, maxPercentDifference, message) {
* @param {Float} expected
* @param {Float} minDifference (the minimum exclusive difference allowed between the actual and expected numbers)
* @param {string} [message] Defaults to structured message
* @returns {undefined}
* @returns {void}
*/
function notClose (actual, expected, minDifference, message) {
const actualDiff = Math.abs(actual - expected),
@@ -76,7 +76,7 @@ function notClose (actual, expected, minDifference, message) {
* @param {Float} expected
* @param {Float} minPercentDifference (the minimum exclusive difference percentage allowed between the actual and expected numbers)
* @param {string} [message] Defaults to a structured message
* @returns {undefined}
* @returns {void}
*/
function notClosePercent (actual, expected, minPercentDifference, message) {
let actualDiff, result;

View File

@@ -3,7 +3,7 @@
* @param {GenericObject} obj
* @param {GenericCallback} fn
* @param {Any} arg1
* @returns {undefined}
* @returns {void}
*/
function expectOutOfBoundsException (obj, fn, arg1) {
const expected = true;

View File

@@ -23,7 +23,7 @@ let elemId = 1;
/**
* Initilize modules to set up the tests.
* @returns {undefined}
* @returns {void}
*/
function setUp () {
utilities.init(
@@ -65,7 +65,7 @@ let elem;
/**
* Initialize for tests and set up `rect` element.
* @returns {undefined}
* @returns {void}
*/
function setUpRect () {
setUp();
@@ -79,7 +79,7 @@ function setUpRect () {
/**
* Initialize for tests and set up `text` element with `tspan` child.
* @returns {undefined}
* @returns {void}
*/
function setUpTextWithTspan () {
setUp();
@@ -99,7 +99,7 @@ function setUpTextWithTspan () {
/**
* Tear down the tests (empty the svg element).
* @returns {undefined}
* @returns {void}
*/
function tearDown () {
while (svg.hasChildNodes()) {

View File

@@ -35,7 +35,7 @@ const mockFactory = {
/**
* Potentially reusable test set-up.
* @returns {undefined}
* @returns {void}
*/
function setUp () {
svgroot = mockFactory.createSVGElement({
@@ -72,7 +72,7 @@ function setUpWithInit () {
/**
* Tear down the test by emptying our sandbox area.
* @returns {undefined}
* @returns {void}
*/
function tearDown () {
while (sandbox.hasChildNodes()) {

View File

@@ -12,7 +12,7 @@
* @param {PlainObject} implementations
* @param {external:sinon} implementations.sinon
* @param {external:QUnit} implementations.QUnit
* @returns {undefined}
* @returns {void}
*/
export default function sinonQunit ({sinon, QUnit}) {
sinon.assert.fail = function (msg) {

View File

@@ -23,7 +23,7 @@ let svgcontent, rect, circle;
/**
* Set up tests, adding elements.
* @returns {undefined}
* @returns {void}
*/
function setUp () {
svgcontent = svgroot.appendChild(document.createElementNS(NS.SVG, 'svg'));
@@ -35,7 +35,7 @@ function setUp () {
/**
* Tear down tests, emptying SVG root, and resetting list map.
* @returns {undefined}
* @returns {void}
*/
function tearDown () {
transformlist.resetListMap();

View File

@@ -10,7 +10,7 @@ QUnit.log((details) => {
/**
* Set up tests, supplying mock data.
* @returns {undefined}
* @returns {void}
*/
function setUp () {
units.init(

View File

@@ -46,7 +46,7 @@ const textWithMatrixTransform = document.getElementById('svg_text_with_matrix_tr
* Toward performance testing, fill document with clones of element.
* @param {SVGElement} elem
* @param {Integer} count
* @returns {undefined}
* @returns {void}
*/
function fillDocumentByCloningElement (elem, count) {
const elemId = elem.getAttribute('id') + '-';

View File

@@ -65,21 +65,21 @@ const mockCount = {
/**
* Increments clear seleciton count for mock test.
* @returns {undefined}
* @returns {void}
*/
function mockClearSelection () {
mockCount.clearSelection++;
}
/**
* Increments add selection count for mock test.
* @returns {undefined}
* @returns {void}
*/
function mockAddToSelection () {
mockCount.addToSelection++;
}
/**
* Increments add command to history count for mock test.
* @returns {undefined}
* @returns {void}
*/
function mockAddCommandToHistory () {
mockCount.addCommandToHistory++;