From e5a3062cbbbbeac0497ad9da804a03b942511b0c Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Wed, 25 Nov 2020 04:50:48 -0500 Subject: [PATCH] tests: Delete trailing commas in function arguments (#4516) * lint: Bump eslint-config-etherpad to 1.0.11 * lint: Rerun `eslint --fix` to nuke trailing function call commas eslint-config-etherpad 1.0.11 changed the comma-dangle rule to prohibit trailing commas for function arguments. See: https://github.com/ether/eslint-config-etherpad/commit/673ab07acfdf9df5eb6e6580703e7715c7cb1354 Re-run the automated fixes to apply the rule change. This also fixes a few lint issues in changes that were made after `eslint --fix` was originally run. --- package-lock.json | 6 +++--- package.json | 2 +- tests/frontend/specs/change_user_color.js | 2 +- tests/frontend/specs/change_user_name.js | 2 +- tests/frontend/specs/clear_authorship_colors.js | 4 ++-- tests/frontend/specs/importexport.js | 2 +- tests/frontend/specs/responsiveness.js | 2 +- tests/frontend/specs/timeslider.js | 2 +- tests/frontend/specs/timeslider_follow.js | 2 +- tests/frontend/travis/remote_runner.js | 6 +++--- 10 files changed, 15 insertions(+), 15 deletions(-) diff --git a/package-lock.json b/package-lock.json index 5fe896aa4..6bd87113e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9921,9 +9921,9 @@ } }, "eslint-config-etherpad": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/eslint-config-etherpad/-/eslint-config-etherpad-1.0.9.tgz", - "integrity": "sha512-g/yRRKiNL3k/VO6zizq13CKNEIHOQli6LpenSCGhfolZid3TVe/8D9mnFML3gtNcqTNZj5L15N2U/05ip7sD7Q==", + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/eslint-config-etherpad/-/eslint-config-etherpad-1.0.11.tgz", + "integrity": "sha512-/MPV8rtPB/mRbfX/Xtw4IulERSj14IWHLp2dU+0a5lz3qfLl8ZKTkp6WHCcj3Uf+mQh4yWEACeqRYZ77ErNtzw==", "dev": true }, "eslint-plugin-es": { diff --git a/package.json b/package.json index 0939171c8..730b0e99b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ }, "devDependencies": { "eslint": "^7.13.0", - "eslint-config-etherpad": "^1.0.9", + "eslint-config-etherpad": "^1.0.11", "eslint-plugin-mocha": "^8.0.0", "eslint-plugin-node": "^11.1.0", "eslint-plugin-prefer-arrow": "^1.2.2", diff --git a/tests/frontend/specs/change_user_color.js b/tests/frontend/specs/change_user_color.js index 3b4b3d20e..e8c16db37 100644 --- a/tests/frontend/specs/change_user_color.js +++ b/tests/frontend/specs/change_user_color.js @@ -93,7 +93,7 @@ describe('change user color', function () { $chatInput.sendkeys('{enter}'); // simulate a keypress of enter actually does evt.which = 10 not 13 // check if chat shows up - helper.waitFor(() => chrome$('#chattext').children('p').length !== 0, // wait until the chat message shows up + helper.waitFor(() => chrome$('#chattext').children('p').length !== 0 // wait until the chat message shows up ).done(() => { const $firstChatMessage = chrome$('#chattext').children('p'); expect($firstChatMessage.css('background-color')).to.be(testColorRGB); // expect the first chat message to be of the user's color diff --git a/tests/frontend/specs/change_user_name.js b/tests/frontend/specs/change_user_name.js index d0d9b763c..e144a2340 100644 --- a/tests/frontend/specs/change_user_name.js +++ b/tests/frontend/specs/change_user_name.js @@ -60,7 +60,7 @@ describe('change username value', function () { $chatInput.sendkeys('{enter}'); // simulate a keypress of enter actually does evt.which = 10 not 13 // check if chat shows up - helper.waitFor(() => chrome$('#chattext').children('p').length !== 0, // wait until the chat message shows up + helper.waitFor(() => chrome$('#chattext').children('p').length !== 0 // wait until the chat message shows up ).done(() => { const $firstChatMessage = chrome$('#chattext').children('p'); const containsJohnMcLear = $firstChatMessage.text().indexOf('John McLear') !== -1; // does the string contain John McLear diff --git a/tests/frontend/specs/clear_authorship_colors.js b/tests/frontend/specs/clear_authorship_colors.js index 0be189625..f622e912a 100644 --- a/tests/frontend/specs/clear_authorship_colors.js +++ b/tests/frontend/specs/clear_authorship_colors.js @@ -28,7 +28,7 @@ describe('clear authorship colors button', function () { $firstTextElement.sendkeys(sentText); $firstTextElement.sendkeys('{rightarrow}'); - helper.waitFor(() => inner$('div span').first().attr('class').indexOf('author') !== -1, // wait until we have the full value available + helper.waitFor(() => inner$('div span').first().attr('class').indexOf('author') !== -1 // wait until we have the full value available ).done(() => { // IE hates you if you don't give focus to the inner frame bevore you do a clearAuthorship inner$('div').first().focus(); @@ -80,7 +80,7 @@ describe('clear authorship colors button', function () { $firstTextElement.sendkeys(sentText); $firstTextElement.sendkeys('{rightarrow}'); - helper.waitFor(() => inner$('div span').first().attr('class').indexOf('author') !== -1, // wait until we have the full value available + helper.waitFor(() => inner$('div span').first().attr('class').indexOf('author') !== -1 // wait until we have the full value available ).done(() => { // IE hates you if you don't give focus to the inner frame bevore you do a clearAuthorship inner$('div').first().focus(); diff --git a/tests/frontend/specs/importexport.js b/tests/frontend/specs/importexport.js index 7f3e4c415..0be2a0744 100644 --- a/tests/frontend/specs/importexport.js +++ b/tests/frontend/specs/importexport.js @@ -136,7 +136,7 @@ describe('import functionality', function () { const htmlWithBullets = ''; importrequest(htmlWithBullets, importurl, 'html'); const oldtext = getinnertext(); - helper.waitFor(() => oldtext != getinnertext(), + helper.waitFor(() => oldtext != getinnertext() // return expect(getinnertext()).to.be('\ // \n\ // \n\ diff --git a/tests/frontend/specs/responsiveness.js b/tests/frontend/specs/responsiveness.js index 1c3a0c65b..63803f641 100644 --- a/tests/frontend/specs/responsiveness.js +++ b/tests/frontend/specs/responsiveness.js @@ -53,7 +53,7 @@ xdescribe('Responsiveness of Editor', function () { inner$('div').first().text(text); // Put the text contents into the pad helper.waitFor(() => // Wait for the new contents to be on the pad - inner$('div').text().length > length, + inner$('div').text().length > length ).done(() => { expect(inner$('div').text().length).to.be.greaterThan(length); // has the text changed? const start = Date.now(); // get the start time diff --git a/tests/frontend/specs/timeslider.js b/tests/frontend/specs/timeslider.js index f0d74b1ef..bea7932df 100644 --- a/tests/frontend/specs/timeslider.js +++ b/tests/frontend/specs/timeslider.js @@ -18,7 +18,7 @@ xdescribe('timeslider button takes you to the timeslider of a pad', function () const modifiedValue = $firstTextElement.text(); // get the modified value expect(modifiedValue).not.to.be(originalValue); // expect the value to change - helper.waitFor(() => modifiedValue !== originalValue, // The value has changed so we can.. + helper.waitFor(() => modifiedValue !== originalValue // The value has changed so we can.. ).done(() => { const $timesliderButton = chrome$('#timesliderlink'); $timesliderButton.click(); // So click the timeslider link diff --git a/tests/frontend/specs/timeslider_follow.js b/tests/frontend/specs/timeslider_follow.js index 55502d869..c570cbd07 100644 --- a/tests/frontend/specs/timeslider_follow.js +++ b/tests/frontend/specs/timeslider_follow.js @@ -42,7 +42,7 @@ describe('timeslider follow', function () { const lines = helper.linesDiv(); helper.selectLines(lines[0], lines[lines.length - 1]); // select all lines // probably unnecessary, but wait for the selection to be Range not Caret - await helper.waitForPromise(() => !helper.padInner$.document.getSelection().isCollapsed, + await helper.waitForPromise(() => !helper.padInner$.document.getSelection().isCollapsed // only supported in FF57+ // return helper.padInner$.document.getSelection().type === 'Range'; ); diff --git a/tests/frontend/travis/remote_runner.js b/tests/frontend/travis/remote_runner.js index b2c9f3a00..70c850ca8 100644 --- a/tests/frontend/travis/remote_runner.js +++ b/tests/frontend/travis/remote_runner.js @@ -15,10 +15,10 @@ var allTestsPassed = true; // and the script would silently exit with error code 0 process.exitCode = 2; process.on('exit', (code) => { - if (code === 2){ - console.log("\x1B[31mFAILED\x1B[39m Not all saucelabs runner have been started."); + if (code === 2) { + console.log('\x1B[31mFAILED\x1B[39m Not all saucelabs runner have been started.'); } -}) +}); var sauceTestWorker = async.queue((testSettings, callback) => { const browser = wd.promiseChainRemote(config.host, config.port, config.username, config.accessKey);