From b2939cdf19ff9f2a383979687243532affc07bd2 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Fri, 7 Dec 2018 13:14:28 -0800 Subject: [PATCH] lint: Fix comma spacing in node tests. I apparently failed to check the tests codebase before merging the last linter commit. Oops. --- frontend_tests/casper_tests/06-settings.js | 4 +-- frontend_tests/node_tests/bot_data.js | 2 +- .../node_tests/composebox_typeahead.js | 4 +-- frontend_tests/node_tests/message_store.js | 2 +- frontend_tests/node_tests/narrow.js | 28 +++++++++---------- frontend_tests/node_tests/schema.js | 2 +- frontend_tests/node_tests/server_events.js | 8 +++--- frontend_tests/node_tests/templates.js | 4 +-- frontend_tests/node_tests/timerender.js | 2 +- frontend_tests/node_tests/util.js | 8 +++--- frontend_tests/zjsunit/mdiff.js | 4 +-- 11 files changed, 34 insertions(+), 34 deletions(-) diff --git a/frontend_tests/casper_tests/06-settings.js b/frontend_tests/casper_tests/06-settings.js index b1517acc3d..8ff1e586aa 100644 --- a/frontend_tests/casper_tests/06-settings.js +++ b/frontend_tests/casper_tests/06-settings.js @@ -114,7 +114,7 @@ casper.then(function () { casper.then(function create_bot() { casper.test.info('Filling out the create bot form for an outgoing webhook bot'); - casper.fill('#create_bot_form',{ + casper.fill('#create_bot_form', { bot_name: 'Bot 1', bot_short_name: '1', bot_type: OUTGOING_WEBHOOK_BOT_TYPE, @@ -146,7 +146,7 @@ casper.then(function () { casper.then(function create_bot() { casper.test.info('Filling out the create bot form for a normal bot'); - casper.fill('#create_bot_form',{ + casper.fill('#create_bot_form', { bot_name: 'Bot 2', bot_short_name: '2', bot_type: GENERIC_BOT_TYPE, diff --git a/frontend_tests/node_tests/bot_data.js b/frontend_tests/node_tests/bot_data.js index 52e8544264..c053f3fdc8 100644 --- a/frontend_tests/node_tests/bot_data.js +++ b/frontend_tests/node_tests/bot_data.js @@ -137,7 +137,7 @@ run_test('test_basics', () => { (function test_get_editable() { let can_admin; - bot_data.add({...test_bot ,user_id: 44, owner: 'owner@zulip.com', is_active: true}); + bot_data.add({...test_bot, user_id: 44, owner: 'owner@zulip.com', is_active: true}); bot_data.add({...test_bot, user_id: 45, email: 'bot2@zulip.com', owner: 'owner@zulip.com', is_active: true}); bot_data.add({...test_bot, user_id: 46, email: 'bot3@zulip.com', owner: 'not_owner@zulip.com', is_active: true}); diff --git a/frontend_tests/node_tests/composebox_typeahead.js b/frontend_tests/node_tests/composebox_typeahead.js index 953aaa035c..996e5929aa 100644 --- a/frontend_tests/node_tests/composebox_typeahead.js +++ b/frontend_tests/node_tests/composebox_typeahead.js @@ -1245,8 +1245,8 @@ run_test('typeahead_results', () => { assert.deepEqual(returned, expected); } - assert_emoji_matches('da',[{emoji_name: "tada", emoji_url: "TBD", codepoint: "1f389"}, - {emoji_name: "panda_face", emoji_url: "TBD", codepoint: "1f43c"}]); + assert_emoji_matches('da', [{emoji_name: "tada", emoji_url: "TBD", codepoint: "1f389"}, + {emoji_name: "panda_face", emoji_url: "TBD", codepoint: "1f43c"}]); assert_emoji_matches('da_', []); assert_emoji_matches('da ', []); assert_emoji_matches('panda ', [{emoji_name: "panda_face", emoji_url: "TBD", codepoint: "1f43c"}]); diff --git a/frontend_tests/node_tests/message_store.js b/frontend_tests/node_tests/message_store.js index 452136a688..0039ea4535 100644 --- a/frontend_tests/node_tests/message_store.js +++ b/frontend_tests/node_tests/message_store.js @@ -13,7 +13,7 @@ set_global('alert_words', { process_message: noop, }); -set_global('topic_data' , { +set_global('topic_data', { add_message: noop, }); diff --git a/frontend_tests/node_tests/narrow.js b/frontend_tests/node_tests/narrow.js index 55c9ccccd8..c558e65df8 100644 --- a/frontend_tests/node_tests/narrow.js +++ b/frontend_tests/node_tests/narrow.js @@ -105,77 +105,77 @@ run_test('show_empty_narrow_message', () => { narrow_state.reset_current_filter(); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#empty_narrow_message'); assert.equal(attr_id, '#left_bar_compose_reply_button_big'); // for non-existent or private stream set_filter([['stream', 'Foo']]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#nonsubbed_private_nonexistent_stream_narrow_message'); // for non sub public stream stream_data.add_sub('ROME', {name: 'ROME', stream_id: 99}); set_filter([['stream', 'Rome']]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#nonsubbed_stream_narrow_message'); set_filter([['is', 'starred']]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#empty_star_narrow_message'); set_filter([['is', 'mentioned']]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#empty_narrow_all_mentioned'); set_filter([['is', 'private']]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#empty_narrow_all_private_message'); set_filter([['is', 'unread']]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#no_unread_narrow_message'); set_filter([['pm-with', ['Yo']]]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#non_existing_user'); people.add_in_realm(alice); set_filter([['pm-with', ['alice@example.com', 'Yo']]]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#non_existing_users'); set_filter([['pm-with', 'alice@example.com']]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#empty_narrow_private_message'); set_filter([['group-pm-with', 'alice@example.com']]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#empty_narrow_group_private_message'); set_filter([['sender', 'ray@example.com']]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#silent_user'); set_filter([['sender', 'sinwar@example.com']]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#non_existing_user'); set_filter([['search', 'grail']]); narrow.show_empty_narrow_message(); - assert.equal(hide_id,'.empty_feed_notice'); + assert.equal(hide_id, '.empty_feed_notice'); assert.equal(show_id, '#empty_search_narrow_message'); }); diff --git a/frontend_tests/node_tests/schema.js b/frontend_tests/node_tests/schema.js index fe626e79c8..2c32ac7d74 100644 --- a/frontend_tests/node_tests/schema.js +++ b/frontend_tests/node_tests/schema.js @@ -2,7 +2,7 @@ zrequire('schema'); run_test('basics', () => { assert.equal(schema.check_string('x', 'fred'), undefined); - assert.equal(schema.check_string('x', [1,2]), 'x is not a string'); + assert.equal(schema.check_string('x', [1, 2]), 'x is not a string'); const fields = { foo: schema.check_string, diff --git a/frontend_tests/node_tests/server_events.js b/frontend_tests/node_tests/server_events.js index a55a0cec3b..225aae2a73 100644 --- a/frontend_tests/node_tests/server_events.js +++ b/frontend_tests/node_tests/server_events.js @@ -106,10 +106,10 @@ run_test('event_dispatch_error', () => { const logs = blueslip.get_test_logs('error'); assert.equal(logs.length, 1); - assert.equal(logs[0].more_info.event.type , 'stream'); - assert.equal(logs[0].more_info.event.op , 'update'); - assert.equal(logs[0].more_info.event.id , 1); - assert.equal(logs[0].more_info.other , undefined); + assert.equal(logs[0].more_info.event.type, 'stream'); + assert.equal(logs[0].more_info.event.op, 'update'); + assert.equal(logs[0].more_info.event.id, 1); + assert.equal(logs[0].more_info.other, undefined); blueslip.clear_test_data(); }); diff --git a/frontend_tests/node_tests/templates.js b/frontend_tests/node_tests/templates.js index 029cd94f32..d05a7a6757 100644 --- a/frontend_tests/node_tests/templates.js +++ b/frontend_tests/node_tests/templates.js @@ -419,11 +419,11 @@ run_test('alert_word_settings_item', () => { var li = $(html).find("li.alert-word-item:first"); var value = li.find('.value'); var button = li.find('button'); - assert.equal(li.attr('data-word'),'lunch'); + assert.equal(li.attr('data-word'), 'lunch'); assert.equal(value.length, 1); assert.equal(value.text(), 'lunch'); assert.equal(button.attr('title'), 'translated: Delete alert word'); - assert.equal(button.attr('data-word'),'lunch'); + assert.equal(button.attr('data-word'), 'lunch'); var title = $(html).find('.new-alert-word-section-title'); var textbox = $(html).find('#create_alert_word_name'); diff --git a/frontend_tests/node_tests/timerender.js b/frontend_tests/node_tests/timerender.js index b477977d95..bb9e7826ac 100644 --- a/frontend_tests/node_tests/timerender.js +++ b/frontend_tests/node_tests/timerender.js @@ -1,6 +1,6 @@ set_global('$', global.make_zjquery()); set_global('i18n', global.stub_i18n); -set_global('page_params' , { +set_global('page_params', { twenty_four_hour_time: true, }); zrequire('XDate', 'xdate'); diff --git a/frontend_tests/node_tests/util.js b/frontend_tests/node_tests/util.js index abc118de47..74cdc03806 100644 --- a/frontend_tests/node_tests/util.js +++ b/frontend_tests/node_tests/util.js @@ -126,10 +126,10 @@ run_test('is_mobile', () => { run_test('array_compare', () => { assert(util.array_compare([], [])); - assert(util.array_compare([1,2,3], [1,2,3])); - assert(!util.array_compare([1,2], [1,2,3])); - assert(!util.array_compare([1,2,3], [1,2])); - assert(!util.array_compare([1,2,3,4], [1,2,3,5])); + assert(util.array_compare([1, 2, 3], [1, 2, 3])); + assert(!util.array_compare([1, 2], [1, 2, 3])); + assert(!util.array_compare([1, 2, 3], [1, 2])); + assert(!util.array_compare([1, 2, 3, 4], [1, 2, 3, 5])); }); run_test('normalize_recipients', () => { diff --git a/frontend_tests/zjsunit/mdiff.js b/frontend_tests/zjsunit/mdiff.js index 75cae31382..e392620d2b 100644 --- a/frontend_tests/zjsunit/mdiff.js +++ b/frontend_tests/zjsunit/mdiff.js @@ -16,7 +16,7 @@ const difflib = require('difflib'); function apply_color(input_string, changes) { let previous_index = 0; - let processed_string = input_string.slice(0,2); + let processed_string = input_string.slice(0, 2); input_string = input_string.slice(2); const formatter = { @@ -116,7 +116,7 @@ function diff_strings(string_0, string_1) { }); const emphasize_codes = (string) => { - return "\u001b[34m" + string.slice(0,1) + "\u001b[0m" + string.slice(1); + return "\u001b[34m" + string.slice(0, 1) + "\u001b[0m" + string.slice(1); }; output_lines = _.map(output_lines, emphasize_codes);