From 687f1b165171c0258e9cd546c921dda5f392d650 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Tue, 12 Nov 2024 22:05:32 -0800 Subject: [PATCH] tests: Rename the Node tests to *.cjs. Signed-off-by: Anders Kaseorg --- docs/subsystems/events-system.md | 4 +- docs/subsystems/markdown.md | 2 +- docs/testing/testing-with-node.md | 14 +++---- docs/tutorials/new-feature-tutorial.md | 6 +-- tools/check-schemas | 2 +- tools/linter_lib/custom_check.py | 2 +- tools/node_lib/dump_fixtures.js | 2 +- tools/test-js-with-node | 37 ++++++++++--------- .../{activity.test.js => activity.test.cjs} | 12 +++--- ...ert_words.test.js => alert_words.test.cjs} | 4 +- ...rds_ui.test.js => alert_words_ui.test.cjs} | 8 ++-- ...e.test.js => blueslip_stacktrace.test.cjs} | 4 +- .../{bot_data.test.js => bot_data.test.cjs} | 4 +- ...story.test.js => browser_history.test.cjs} | 8 ++-- ...buddy_data.test.js => buddy_data.test.cjs} | 8 ++-- ...buddy_list.test.js => buddy_list.test.cjs} | 10 ++--- .../{channel.test.js => channel.test.cjs} | 8 ++-- ...color_data.test.js => color_data.test.cjs} | 4 +- web/tests/{common.test.js => common.test.cjs} | 6 +-- ...components.test.js => components.test.cjs} | 8 ++-- .../{compose.test.js => compose.test.cjs} | 10 ++--- ...tions.test.js => compose_actions.test.cjs} | 10 ++--- ..._ui.test.js => compose_closed_ui.test.cjs} | 6 +-- ...ose_fade.test.js => compose_fade.test.cjs} | 4 +- ..._pill.test.js => compose_pm_pill.test.cjs} | 6 +-- ...e_state.test.js => compose_state.test.cjs} | 6 +-- ...compose_ui.test.js => compose_ui.test.cjs} | 8 ++-- ...date.test.js => compose_validate.test.cjs} | 12 +++--- ...e_video.test.js => compose_video.test.cjs} | 10 ++--- ....test.js => composebox_typeahead.test.cjs} | 8 ++-- ..._paste.test.js => copy_and_paste.test.cjs} | 4 +- ....js => deprecated_feature_notice.test.cjs} | 4 +- .../{dispatch.test.js => dispatch.test.cjs} | 16 ++++---- ...ch_subs.test.js => dispatch_subs.test.cjs} | 10 ++--- web/tests/{drafts.test.js => drafts.test.cjs} | 8 ++-- web/tests/{echo.test.js => echo.test.cjs} | 6 +-- web/tests/{emoji.test.js => emoji.test.cjs} | 8 ++-- ...i_picker.test.js => emoji_picker.test.cjs} | 4 +- .../{example1.test.js => example1.test.cjs} | 12 +++--- .../{example2.test.js => example2.test.cjs} | 8 ++-- .../{example3.test.js => example3.test.cjs} | 6 +-- .../{example4.test.js => example4.test.cjs} | 8 ++-- .../{example5.test.js => example5.test.cjs} | 6 +-- .../{example6.test.js => example6.test.cjs} | 4 +- .../{example7.test.js => example7.test.cjs} | 8 ++-- .../{example8.test.js => example8.test.cjs} | 8 ++-- ...nced_code.test.js => fenced_code.test.cjs} | 4 +- ...h_status.test.js => fetch_status.test.cjs} | 4 +- web/tests/{filter.test.js => filter.test.cjs} | 10 ++--- .../{fold_dict.test.js => fold_dict.test.cjs} | 4 +- ...u_util.test.js => gear_menu_util.test.cjs} | 4 +- .../{hash_util.test.js => hash_util.test.cjs} | 4 +- ...hashchange.test.js => hashchange.test.cjs} | 8 ++-- web/tests/{hotkey.test.js => hotkey.test.cjs} | 8 ++-- web/tests/{i18n.test.js => i18n.test.cjs} | 6 +-- ...input_pill.test.js => input_pill.test.cjs} | 6 +-- ...rnal_url.test.js => internal_url.test.cjs} | 4 +- ...own_util.test.js => keydown_util.test.cjs} | 6 +-- .../{lazy_set.test.js => lazy_set.test.cjs} | 6 +-- ... => left_sidebar_navigation_area.test.cjs} | 6 +-- .../lib/{buddy_list.js => buddy_list.cjs} | 4 +- .../{compose_banner.js => compose_banner.cjs} | 4 +- web/tests/lib/{events.js => events.cjs} | 0 .../{example_stream.js => example_stream.cjs} | 0 .../lib/{example_user.js => example_user.cjs} | 0 .../lib/{handlebars.js => handlebars.cjs} | 0 web/tests/lib/{i18n.js => i18n.cjs} | 0 web/tests/lib/{index.js => index.cjs} | 18 ++++----- ...markdown_assert.js => markdown_assert.cjs} | 2 +- web/tests/lib/{mdiff.js => mdiff.cjs} | 0 web/tests/lib/{namespace.js => namespace.cjs} | 4 +- .../lib/{real_jquery.js => real_jquery.cjs} | 0 web/tests/lib/{stub.js => stub.cjs} | 0 web/tests/lib/{test.js => test.cjs} | 10 ++--- web/tests/lib/{zblueslip.js => zblueslip.cjs} | 0 web/tests/lib/{zjquery.js => zjquery.cjs} | 4 +- ...zjquery_element.js => zjquery_element.cjs} | 2 +- .../{zjquery_event.js => zjquery_event.cjs} | 0 ...ing_params.js => zpage_billing_params.cjs} | 0 .../lib/{zpage_params.js => zpage_params.cjs} | 0 ...linkifiers.test.js => linkifiers.test.cjs} | 6 +-- ...st_cursor.test.js => list_cursor.test.cjs} | 8 ++-- ...st_widget.test.js => list_widget.test.cjs} | 8 ++-- .../{markdown.test.js => markdown.test.cjs} | 8 ++-- ..._parse.test.js => markdown_parse.test.cjs} | 4 +- ...age_edit.test.js => message_edit.test.cjs} | 4 +- ...events.test.js => message_events.test.cjs} | 6 +-- ...e_flags.test.js => message_flags.test.cjs} | 4 +- ...age_list.test.js => message_list.test.cjs} | 10 ++--- ...ata.test.js => message_list_data.test.cjs} | 6 +-- ...iew.test.js => message_list_view.test.cjs} | 6 +-- ...e_store.test.js => message_store.test.cjs} | 6 +-- ...age_view.test.js => message_view.test.cjs} | 10 ++--- ...ted_users.test.js => muted_users.test.cjs} | 4 +- ...ow_local.test.js => narrow_local.test.cjs} | 4 +- ...ow_state.test.js => narrow_state.test.cjs} | 6 +-- ..._unread.test.js => narrow_unread.test.cjs} | 6 +-- ..._alerts.test.js => navbar_alerts.test.cjs} | 6 +-- ...cations.test.js => notifications.test.cjs} | 8 ++-- .../{password.test.js => password.test.cjs} | 4 +- .../{peer_data.test.js => peer_data.test.cjs} | 8 ++-- web/tests/{people.test.js => people.test.cjs} | 10 ++--- ..._errors.test.js => people_errors.test.cjs} | 6 +-- ...eahead.test.js => pill_typeahead.test.cjs} | 10 ++--- ...ions.test.js => pm_conversations.test.cjs} | 4 +- .../{pm_list.test.js => pm_list.test.cjs} | 6 +-- ...ist_data.test.js => pm_list_data.test.cjs} | 6 +-- ...ll_widget.test.js => poll_widget.test.cjs} | 8 ++-- ...ta.test.js => popover_menus_data.test.cjs} | 8 ++-- ...t.test.js => postprocess_content.test.cjs} | 4 +- .../{presence.test.js => presence.test.cjs} | 4 +- .../{reactions.test.js => reactions.test.cjs} | 12 +++--- ...ound.test.js => realm_playground.test.cjs} | 4 +- ...enders.test.js => recent_senders.test.cjs} | 4 +- ...cent_view.test.js => recent_view.test.cjs} | 10 ++--- web/tests/{reload.test.js => reload.test.cjs} | 4 +- ...ad_state.test.js => reload_state.test.cjs} | 4 +- ...own.test.js => rendered_markdown.test.cjs} | 10 ++--- ..._topic.test.js => resolved_topic.test.cjs} | 4 +- web/tests/{rtl.test.js => rtl.test.cjs} | 6 +-- ...ippets.test.js => saved_snippets.test.cjs} | 8 ++-- ...es.test.js => scheduled_messages.test.cjs} | 4 +- ...roll_util.test.js => scroll_util.test.cjs} | 4 +- web/tests/{search.test.js => search.test.cjs} | 6 +-- ...ion.test.js => search_suggestion.test.cjs} | 6 +-- ..._events.test.js => server_events.test.cjs} | 8 ++-- ...gs_bots.test.js => settings_bots.test.cjs} | 4 +- ...onfig.test.js => settings_config.test.cjs} | 4 +- ...gs_data.test.js => settings_data.test.cjs} | 6 +-- ..._emoji.test.js => settings_emoji.test.cjs} | 6 +-- ....test.js => settings_muted_users.test.cjs} | 6 +-- ...ings_org.test.js => settings_org.test.cjs} | 8 ++-- ...st.js => settings_profile_fields.test.cjs} | 6 +-- ...est.js => settings_realm_domains.test.cjs} | 6 +-- ....test.js => settings_user_topics.test.cjs} | 6 +-- .../{spoilers.test.js => spoilers.test.cjs} | 6 +-- ...ages.test.js => starred_messages.test.cjs} | 6 +-- ...> stream_create_subscribers_data.test.cjs} | 4 +- ...ream_data.test.js => stream_data.test.cjs} | 8 ++-- ...ream_edit.test.js => stream_edit.test.cjs} | 2 +- ..._events.test.js => stream_events.test.cjs} | 10 ++--- ...ream_list.test.js => stream_list.test.cjs} | 8 ++-- ...sort.test.js => stream_list_sort.test.cjs} | 4 +- ...ream_pill.test.js => stream_pill.test.cjs} | 4 +- ..._search.test.js => stream_search.test.cjs} | 6 +-- ...ui.test.js => stream_settings_ui.test.cjs} | 6 +-- ....test.js => stream_topic_history.test.cjs} | 4 +- ...submessage.test.js => submessage.test.cjs} | 6 +-- .../{support.test.js => support.test.cjs} | 6 +-- .../{templates.test.js => templates.test.cjs} | 2 +- ...e_util.test.js => time_zone_util.test.cjs} | 4 +- ...timerender.test.js => timerender.test.cjs} | 8 ++-- ...rator.test.js => topic_generator.test.cjs} | 4 +- ..._util.test.js => topic_link_util.test.cjs} | 4 +- ..._data.test.js => topic_list_data.test.cjs} | 4 +- .../{transmit.test.js => transmit.test.cjs} | 6 +-- .../{typeahead.test.js => typeahead.test.cjs} | 4 +- ...lper.test.js => typeahead_helper.test.cjs} | 4 +- ...ping_data.test.js => typing_data.test.cjs} | 4 +- ..._events.test.js => typing_events.test.cjs} | 6 +-- ..._status.test.js => typing_status.test.cjs} | 4 +- .../{ui_util.test.js => ui_util.test.cjs} | 6 +-- web/tests/{unread.test.js => unread.test.cjs} | 4 +- web/tests/{upload.test.js => upload.test.cjs} | 6 +-- ...er_events.test.js => user_events.test.cjs} | 8 ++-- ..._pill.test.js => user_group_pill.test.cjs} | 4 +- ...er_groups.test.js => user_groups.test.cjs} | 6 +-- .../{user_pill.test.js => user_pill.test.cjs} | 6 +-- ...er_search.test.js => user_search.test.cjs} | 6 +-- ...er_status.test.js => user_status.test.cjs} | 4 +- ...er_topics.test.js => user_topics.test.cjs} | 6 +-- ...ics_ui.test.js => user_topics_ui.test.cjs} | 4 +- web/tests/{util.test.js => util.test.cjs} | 4 +- web/tests/{vdom.test.js => vdom.test.cjs} | 6 +-- .../{watchdog.test.js => watchdog.test.cjs} | 6 +-- .../{widgetize.test.js => widgetize.test.cjs} | 8 ++-- .../{zblueslip.test.js => zblueslip.test.cjs} | 8 ++-- .../{zjquery.test.js => zjquery.test.cjs} | 6 +-- zerver/lib/mdiff.py | 2 +- zerver/tests/test_markdown.py | 2 +- 180 files changed, 531 insertions(+), 530 deletions(-) rename web/tests/{activity.test.js => activity.test.cjs} (99%) rename web/tests/{alert_words.test.js => alert_words.test.cjs} (98%) rename web/tests/{alert_words_ui.test.js => alert_words_ui.test.cjs} (95%) rename web/tests/{blueslip_stacktrace.test.js => blueslip_stacktrace.test.cjs} (94%) rename web/tests/{bot_data.test.js => bot_data.test.cjs} (98%) rename web/tests/{browser_history.test.js => browser_history.test.cjs} (92%) rename web/tests/{buddy_data.test.js => buddy_data.test.cjs} (98%) rename web/tests/{buddy_list.test.js => buddy_list.test.cjs} (97%) rename web/tests/{channel.test.js => channel.test.cjs} (98%) rename web/tests/{color_data.test.js => color_data.test.cjs} (89%) rename web/tests/{common.test.js => common.test.cjs} (98%) rename web/tests/{components.test.js => components.test.cjs} (97%) rename web/tests/{compose.test.js => compose.test.cjs} (99%) rename web/tests/{compose_actions.test.js => compose_actions.test.cjs} (98%) rename web/tests/{compose_closed_ui.test.js => compose_closed_ui.test.cjs} (97%) rename web/tests/{compose_fade.test.js => compose_fade.test.cjs} (96%) rename web/tests/{compose_pm_pill.test.js => compose_pm_pill.test.cjs} (97%) rename web/tests/{compose_state.test.js => compose_state.test.cjs} (91%) rename web/tests/{compose_ui.test.js => compose_ui.test.cjs} (99%) rename web/tests/{compose_validate.test.js => compose_validate.test.cjs} (99%) rename web/tests/{compose_video.test.js => compose_video.test.cjs} (97%) rename web/tests/{composebox_typeahead.test.js => composebox_typeahead.test.cjs} (99%) rename web/tests/{copy_and_paste.test.js => copy_and_paste.test.cjs} (99%) rename web/tests/{deprecated_feature_notice.test.js => deprecated_feature_notice.test.cjs} (82%) rename web/tests/{dispatch.test.js => dispatch.test.cjs} (99%) rename web/tests/{dispatch_subs.test.js => dispatch_subs.test.cjs} (97%) rename web/tests/{drafts.test.js => drafts.test.cjs} (99%) rename web/tests/{echo.test.js => echo.test.cjs} (98%) rename web/tests/{emoji.test.js => emoji.test.cjs} (95%) rename web/tests/{emoji_picker.test.js => emoji_picker.test.cjs} (96%) rename web/tests/{example1.test.js => example1.test.cjs} (88%) rename web/tests/{example2.test.js => example2.test.cjs} (93%) rename web/tests/{example3.test.js => example3.test.cjs} (94%) rename web/tests/{example4.test.js => example4.test.cjs} (95%) rename web/tests/{example5.test.js => example5.test.cjs} (96%) rename web/tests/{example6.test.js => example6.test.cjs} (95%) rename web/tests/{example7.test.js => example7.test.cjs} (97%) rename web/tests/{example8.test.js => example8.test.cjs} (96%) rename web/tests/{fenced_code.test.js => fenced_code.test.cjs} (94%) rename web/tests/{fetch_status.test.js => fetch_status.test.cjs} (97%) rename web/tests/{filter.test.js => filter.test.cjs} (99%) rename web/tests/{fold_dict.test.js => fold_dict.test.cjs} (95%) rename web/tests/{gear_menu_util.test.js => gear_menu_util.test.cjs} (97%) rename web/tests/{hash_util.test.js => hash_util.test.cjs} (98%) rename web/tests/{hashchange.test.js => hashchange.test.cjs} (99%) rename web/tests/{hotkey.test.js => hotkey.test.cjs} (99%) rename web/tests/{i18n.test.js => i18n.test.cjs} (97%) rename web/tests/{input_pill.test.js => input_pill.test.cjs} (99%) rename web/tests/{internal_url.test.js => internal_url.test.cjs} (95%) rename web/tests/{keydown_util.test.js => keydown_util.test.cjs} (92%) rename web/tests/{lazy_set.test.js => lazy_set.test.cjs} (83%) rename web/tests/{left_sidebar_navigation_area.test.js => left_sidebar_navigation_area.test.cjs} (98%) rename web/tests/lib/{buddy_list.js => buddy_list.cjs} (95%) rename web/tests/lib/{compose_banner.js => compose_banner.cjs} (95%) rename web/tests/lib/{events.js => events.cjs} (100%) rename web/tests/lib/{example_stream.js => example_stream.cjs} (100%) rename web/tests/lib/{example_user.js => example_user.cjs} (100%) rename web/tests/lib/{handlebars.js => handlebars.cjs} (100%) rename web/tests/lib/{i18n.js => i18n.cjs} (100%) rename web/tests/lib/{index.js => index.cjs} (89%) rename web/tests/lib/{markdown_assert.js => markdown_assert.cjs} (99%) rename web/tests/lib/{mdiff.js => mdiff.cjs} (100%) rename web/tests/lib/{namespace.js => namespace.cjs} (99%) rename web/tests/lib/{real_jquery.js => real_jquery.cjs} (100%) rename web/tests/lib/{stub.js => stub.cjs} (100%) rename web/tests/lib/{test.js => test.cjs} (82%) rename web/tests/lib/{zblueslip.js => zblueslip.cjs} (100%) rename web/tests/lib/{zjquery.js => zjquery.cjs} (98%) rename web/tests/lib/{zjquery_element.js => zjquery_element.cjs} (99%) rename web/tests/lib/{zjquery_event.js => zjquery_event.cjs} (100%) rename web/tests/lib/{zpage_billing_params.js => zpage_billing_params.cjs} (100%) rename web/tests/lib/{zpage_params.js => zpage_params.cjs} (100%) rename web/tests/{linkifiers.test.js => linkifiers.test.cjs} (92%) rename web/tests/{list_cursor.test.js => list_cursor.test.cjs} (94%) rename web/tests/{list_widget.test.js => list_widget.test.cjs} (99%) rename web/tests/{markdown.test.js => markdown.test.cjs} (99%) rename web/tests/{markdown_parse.test.js => markdown_parse.test.cjs} (99%) rename web/tests/{message_edit.test.js => message_edit.test.cjs} (99%) rename web/tests/{message_events.test.js => message_events.test.cjs} (96%) rename web/tests/{message_flags.test.js => message_flags.test.cjs} (99%) rename web/tests/{message_list.test.js => message_list.test.cjs} (98%) rename web/tests/{message_list_data.test.js => message_list_data.test.cjs} (98%) rename web/tests/{message_list_view.test.js => message_list_view.test.cjs} (99%) rename web/tests/{message_store.test.js => message_store.test.cjs} (99%) rename web/tests/{message_view.test.js => message_view.test.cjs} (99%) rename web/tests/{muted_users.test.js => muted_users.test.cjs} (96%) rename web/tests/{narrow_local.test.js => narrow_local.test.cjs} (99%) rename web/tests/{narrow_state.test.js => narrow_state.test.cjs} (98%) rename web/tests/{narrow_unread.test.js => narrow_unread.test.cjs} (98%) rename web/tests/{navbar_alerts.test.js => navbar_alerts.test.cjs} (96%) rename web/tests/{notifications.test.js => notifications.test.cjs} (98%) rename web/tests/{password.test.js => password.test.cjs} (95%) rename web/tests/{peer_data.test.js => peer_data.test.cjs} (98%) rename web/tests/{people.test.js => people.test.cjs} (99%) rename web/tests/{people_errors.test.js => people_errors.test.cjs} (95%) rename web/tests/{pill_typeahead.test.js => pill_typeahead.test.cjs} (99%) rename web/tests/{pm_conversations.test.js => pm_conversations.test.cjs} (98%) rename web/tests/{pm_list.test.js => pm_list.test.cjs} (84%) rename web/tests/{pm_list_data.test.js => pm_list_data.test.cjs} (98%) rename web/tests/{poll_widget.test.js => poll_widget.test.cjs} (98%) rename web/tests/{popover_menus_data.test.js => popover_menus_data.test.cjs} (97%) rename web/tests/{postprocess_content.test.js => postprocess_content.test.cjs} (98%) rename web/tests/{presence.test.js => presence.test.cjs} (98%) rename web/tests/{reactions.test.js => reactions.test.cjs} (99%) rename web/tests/{realm_playground.test.js => realm_playground.test.cjs} (98%) rename web/tests/{recent_senders.test.js => recent_senders.test.cjs} (98%) rename web/tests/{recent_view.test.js => recent_view.test.cjs} (99%) rename web/tests/{reload.test.js => reload.test.cjs} (90%) rename web/tests/{reload_state.test.js => reload_state.test.cjs} (86%) rename web/tests/{rendered_markdown.test.js => rendered_markdown.test.cjs} (99%) rename web/tests/{resolved_topic.test.js => resolved_topic.test.cjs} (95%) rename web/tests/{rtl.test.js => rtl.test.cjs} (98%) rename web/tests/{saved_snippets.test.js => saved_snippets.test.cjs} (92%) rename web/tests/{scheduled_messages.test.js => scheduled_messages.test.cjs} (98%) rename web/tests/{scroll_util.test.js => scroll_util.test.cjs} (96%) rename web/tests/{search.test.js => search.test.cjs} (99%) rename web/tests/{search_suggestion.test.js => search_suggestion.test.cjs} (99%) rename web/tests/{server_events.test.js => server_events.test.cjs} (95%) rename web/tests/{settings_bots.test.js => settings_bots.test.cjs} (96%) rename web/tests/{settings_config.test.js => settings_config.test.cjs} (98%) rename web/tests/{settings_data.test.js => settings_data.test.cjs} (99%) rename web/tests/{settings_emoji.test.js => settings_emoji.test.cjs} (85%) rename web/tests/{settings_muted_users.test.js => settings_muted_users.test.cjs} (95%) rename web/tests/{settings_org.test.js => settings_org.test.cjs} (99%) rename web/tests/{settings_profile_fields.test.js => settings_profile_fields.test.cjs} (98%) rename web/tests/{settings_realm_domains.test.js => settings_realm_domains.test.cjs} (95%) rename web/tests/{settings_user_topics.test.js => settings_user_topics.test.cjs} (95%) rename web/tests/{spoilers.test.js => spoilers.test.cjs} (89%) rename web/tests/{starred_messages.test.js => starred_messages.test.cjs} (97%) rename web/tests/{stream_create_subscribers_data.test.js => stream_create_subscribers_data.test.cjs} (98%) rename web/tests/{stream_data.test.js => stream_data.test.cjs} (99%) rename web/tests/{stream_edit.test.js => stream_edit.test.cjs} (95%) rename web/tests/{stream_events.test.js => stream_events.test.cjs} (98%) rename web/tests/{stream_list.test.js => stream_list.test.cjs} (99%) rename web/tests/{stream_list_sort.test.js => stream_list_sort.test.cjs} (99%) rename web/tests/{stream_pill.test.js => stream_pill.test.cjs} (97%) rename web/tests/{stream_search.test.js => stream_search.test.cjs} (96%) rename web/tests/{stream_settings_ui.test.js => stream_settings_ui.test.cjs} (99%) rename web/tests/{stream_topic_history.test.js => stream_topic_history.test.cjs} (99%) rename web/tests/{submessage.test.js => submessage.test.cjs} (95%) rename web/tests/{support.test.js => support.test.cjs} (91%) rename web/tests/{templates.test.js => templates.test.cjs} (98%) rename web/tests/{time_zone_util.test.js => time_zone_util.test.cjs} (97%) rename web/tests/{timerender.test.js => timerender.test.cjs} (99%) rename web/tests/{topic_generator.test.js => topic_generator.test.cjs} (98%) rename web/tests/{topic_link_util.test.js => topic_link_util.test.cjs} (97%) rename web/tests/{topic_list_data.test.js => topic_list_data.test.cjs} (99%) rename web/tests/{transmit.test.js => transmit.test.cjs} (97%) rename web/tests/{typeahead.test.js => typeahead.test.cjs} (99%) rename web/tests/{typeahead_helper.test.js => typeahead_helper.test.cjs} (99%) rename web/tests/{typing_data.test.js => typing_data.test.cjs} (98%) rename web/tests/{typing_events.test.js => typing_events.test.cjs} (96%) rename web/tests/{typing_status.test.js => typing_status.test.cjs} (99%) rename web/tests/{ui_util.test.js => ui_util.test.cjs} (94%) rename web/tests/{unread.test.js => unread.test.cjs} (99%) rename web/tests/{upload.test.js => upload.test.cjs} (99%) rename web/tests/{user_events.test.js => user_events.test.cjs} (98%) rename web/tests/{user_group_pill.test.js => user_group_pill.test.cjs} (97%) rename web/tests/{user_groups.test.js => user_groups.test.cjs} (99%) rename web/tests/{user_pill.test.js => user_pill.test.cjs} (96%) rename web/tests/{user_search.test.js => user_search.test.cjs} (98%) rename web/tests/{user_status.test.js => user_status.test.cjs} (97%) rename web/tests/{user_topics.test.js => user_topics.test.cjs} (98%) rename web/tests/{user_topics_ui.test.js => user_topics_ui.test.cjs} (97%) rename web/tests/{util.test.js => util.test.cjs} (99%) rename web/tests/{vdom.test.js => vdom.test.cjs} (97%) rename web/tests/{watchdog.test.js => watchdog.test.cjs} (92%) rename web/tests/{widgetize.test.js => widgetize.test.cjs} (97%) rename web/tests/{zblueslip.test.js => zblueslip.test.cjs} (95%) rename web/tests/{zjquery.test.js => zjquery.test.cjs} (98%) diff --git a/docs/subsystems/events-system.md b/docs/subsystems/events-system.md index 76207f0164..ef3a2571fe 100644 --- a/docs/subsystems/events-system.md +++ b/docs/subsystems/events-system.md @@ -381,9 +381,9 @@ node test fixtures and our OpenAPI documentation. #### Node testing Once you've completed backend testing, be sure to add an example event -in `web/tests/lib/events.js`, a test of the +in `web/tests/lib/events.cjs`, a test of the `server_events_dispatch.js` code for that event in -`web/tests/dispatch.test.js`, and verify your example +`web/tests/dispatch.test.cjs`, and verify your example against the two versions of the schema that you declared above using `tools/check-schemas`. diff --git a/docs/subsystems/markdown.md b/docs/subsystems/markdown.md index f532e010cc..2589a20986 100644 --- a/docs/subsystems/markdown.md +++ b/docs/subsystems/markdown.md @@ -41,7 +41,7 @@ message is sent). As a result, we try to make sure that The Python-Markdown implementation is tested by `zerver/tests/test_markdown.py`, and the marked.js implementation and `markdown.contains_backend_only_syntax` are tested by -`web/tests/markdown.test.js`. +`web/tests/markdown.test.cjs`. A shared set of fixed test data ("test fixtures") is present in `zerver/tests/fixtures/markdown_test_cases.json`, and is automatically used diff --git a/docs/testing/testing-with-node.md b/docs/testing/testing-with-node.md index f755777298..cd5ce1ff8c 100644 --- a/docs/testing/testing-with-node.md +++ b/docs/testing/testing-with-node.md @@ -18,7 +18,7 @@ name when debugging something. The JS unit tests are written to work with node. You can find them in `web/tests`. Here is an example test from -`web/tests/stream_data.test.js`: +`web/tests/stream_data.test.cjs`: ```js (function test_get_by_id() { @@ -45,7 +45,7 @@ there are, you should strive to follow the patterns of the existing tests and add your own tests. A good first test to read is -[example1.js](https://github.com/zulip/zulip/blob/main/web/tests/example1.test.js). +[example1.test.cjs](https://github.com/zulip/zulip/blob/main/web/tests/example1.test.cjs). (And then there are several other example files.) ## How the node tests work @@ -60,10 +60,10 @@ those slow down the tests a lot, and often don't add much value. Instead, the preferred model for our unit tests is to mock DOM manipulations (which in Zulip are almost exclusively done via `jQuery`) using a custom library -[zjquery](https://github.com/zulip/zulip/blob/main/web/tests/lib/zjquery.js). +[zjquery](https://github.com/zulip/zulip/blob/main/web/tests/lib/zjquery.cjs). The -[unit test file](https://github.com/zulip/zulip/blob/main/web/tests/zjquery.test.js) +[unit test file](https://github.com/zulip/zulip/blob/main/web/tests/zjquery.test.cjs) for `zjquery` is designed to be also serve as nice documentation for how to use `zjquery`, and is **highly recommended reading** for anyone working on or debugging the Zulip node tests. @@ -149,7 +149,7 @@ narrow_state.stream = function () { ## Creating new test modules -The test runner (`index.js`) automatically runs all .js files in the +The test runner (`index.cjs`) automatically runs all .test.cjs files in the `web/tests` directory, so you can simply start editing a file in that directory to create a new test. @@ -278,7 +278,7 @@ These instructions assume you're using the Vagrant development environment. 1. **Set the `Node.js interpreter path` to `/usr/local/bin/node`** 1. Hit `OK` 2 times to get back to the `Run/Debug Configurations` window. 1. Under `Working Directory` select the root `zulip` directory. - 1. Under `JavaScript file`, enter `web/tests/lib/index.js` + 1. Under `JavaScript file`, enter `web/tests/lib/index.cjs` -- this is the root script for Zulip's node unit tests. Congratulations! You've now set up the integration. @@ -288,7 +288,7 @@ Congratulations! You've now set up the integration. To use Webstorm to debug a given node test file, do the following: 1. Under `Application parameters` choose the node test file that you - are trying to test (e.g., `web/tests/message_store.test.js`). + are trying to test (e.g., `web/tests/message_store.test.cjs`). 1. Under `Path Mappings`, set `Project Root` to `/srv/zulip` (i.e. where the `zulip` Git repository is mounted in the Vagrant guest). 1. Use the WebStorm debugger; see [this overview][webstorm-debugging] diff --git a/docs/tutorials/new-feature-tutorial.md b/docs/tutorials/new-feature-tutorial.md index 54a2035fc1..75ce9d3826 100644 --- a/docs/tutorials/new-feature-tutorial.md +++ b/docs/tutorials/new-feature-tutorial.md @@ -62,7 +62,7 @@ organization in Zulip). The following files are involved in the process: - `web/e2e-tests/admin.test.ts`: end-to-end tests for the organization admin settings pages. -- `web/tests/dispatch.test.js` +- `web/tests/dispatch.test.cjs` **Documentation** @@ -668,11 +668,11 @@ frontend tests: [node-based unit tests](../testing/testing-with-node.md) and At the minimum, if you created a new function to update UI in `settings_org.ts`, you will need to mock that function in -`web/tests/dispatch.test.js`. Add the name of the UI +`web/tests/dispatch.test.cjs`. Add the name of the UI function you created to the following object with `noop` as the value: ```js -// web/tests/dispatch.test.js +// web/tests/dispatch.test.cjs set_global('settings_org', { update_email_change_display: noop, diff --git a/tools/check-schemas b/tools/check-schemas index 0b890008cd..444ff90bf4 100755 --- a/tools/check-schemas +++ b/tools/check-schemas @@ -23,7 +23,7 @@ TOOLS_DIR = os.path.dirname(os.path.abspath(__file__)) sys.path.insert(0, os.path.dirname(TOOLS_DIR)) ROOT_DIR = os.path.dirname(TOOLS_DIR) -EVENTS_JS = "web/tests/lib/events.js" +EVENTS_JS = "web/tests/lib/events.cjs" # check for the venv from tools.lib import sanity_check diff --git a/tools/linter_lib/custom_check.py b/tools/linter_lib/custom_check.py index f3efcfa046..b8ba0a91dc 100644 --- a/tools/linter_lib/custom_check.py +++ b/tools/linter_lib/custom_check.py @@ -207,7 +207,7 @@ js_rules = RuleList( "exclude_pattern": r"(const |\S)style ?=", "description": "Avoid using the `style=` attribute; we prefer styling in CSS files", "exclude": { - "web/tests/copy_and_paste.test.js", + "web/tests/copy_and_paste.test.cjs", }, "good_lines": ["#my-style {color: blue;}", "const style =", 'some_style = "test"'], "bad_lines": ['

Foo

', 'style = "color: blue;"'], diff --git a/tools/node_lib/dump_fixtures.js b/tools/node_lib/dump_fixtures.js index f27b3368a5..8df0004121 100644 --- a/tools/node_lib/dump_fixtures.js +++ b/tools/node_lib/dump_fixtures.js @@ -1,5 +1,5 @@ "use strict"; -const events = require("../../web/tests/lib/events.js"); +const events = require("../../web/tests/lib/events.cjs"); console.info(JSON.stringify(events.fixtures, null, 4)); diff --git a/tools/test-js-with-node b/tools/test-js-with-node index bd98f777f2..830a9bb65d 100755 --- a/tools/test-js-with-node +++ b/tools/test-js-with-node @@ -20,7 +20,7 @@ sanity_check.check_venv(__file__) import orjson from zulint.printer import BOLDRED, CYAN, ENDC, GREEN -INDEX_JS = os.path.join(ROOT_DIR, "web/tests/lib/index.js") +INDEX_JS = os.path.join(ROOT_DIR, "web/tests/lib/index.cjs") NODE_COVERAGE_PATH = os.path.join(ROOT_DIR, "var/node-coverage/coverage-final.json") # Ideally, we wouldn't need this line, but it seems to be required to @@ -28,9 +28,9 @@ NODE_COVERAGE_PATH = os.path.join(ROOT_DIR, "var/node-coverage/coverage-final.js os.chdir(ROOT_DIR) USAGE = """ - tools/test-js-with-node - to run all tests - tools/test-js-with-node util.test.js activity.test.js - to run just a couple tests - tools/test-js-with-node --coverage - to generate coverage report + tools/test-js-with-node - to run all tests + tools/test-js-with-node util.test.cjs activity.test.cjs - to run just a couple tests + tools/test-js-with-node --coverage - to generate coverage report """ @@ -291,14 +291,14 @@ EXEMPT_FILES = make_set( "web/src/zcommand.ts", "web/src/zform.js", "web/src/zulip_test.ts", - "web/tests/lib/example_user.js", - "web/tests/lib/mdiff.js", - "web/tests/lib/real_jquery.js", - "web/tests/lib/zjquery_element.js", - "web/tests/lib/zpage_billing_params.js", + "web/tests/lib/example_user.cjs", + "web/tests/lib/mdiff.cjs", + "web/tests/lib/real_jquery.cjs", + "web/tests/lib/zjquery_element.cjs", + "web/tests/lib/zpage_billing_params.cjs", # There are some important functions which are not called right now but will # be reused when we add tests for dropdown widget so it doesn't make sense to remove them. - "web/tests/recent_view.test.js", + "web/tests/recent_view.test.cjs", ] ) @@ -362,8 +362,8 @@ def print_error(msg: str) -> None: def clean_file(orig_fn: str) -> str: fn = orig_fn - if not fn.endswith(".test.js"): - fn += ".test.js" + if not fn.endswith(".test.cjs"): + fn += ".test.cjs" if "web/tests/" not in fn: fn = os.path.join(ROOT_DIR, "web", "tests", fn) fn = os.path.abspath(fn) @@ -381,7 +381,7 @@ def clean_files(fns: list[str]) -> list[str]: def run_tests_via_node_js() -> int: os.environ["TZ"] = "UTC" - # The index.js test runner is the real "driver" here, and we launch + # The index.cjs test runner is the real "driver" here, and we launch # with either nyc or node, depending on whether we want coverage # reports. Running under nyc is slower and creates funny # tracebacks, so you generally want to get coverage reports only @@ -393,7 +393,7 @@ def run_tests_via_node_js() -> int: parallel = 1 files = individual_files else: - files = sorted(glob.glob(os.path.join(ROOT_DIR, "web/tests/*.test.js"))) + files = sorted(glob.glob(os.path.join(ROOT_DIR, "web/tests/*.test.cjs"))) test_files = clean_files(files) @@ -417,14 +417,15 @@ def run_tests_via_node_js() -> int: coverage_dir = os.path.join(ROOT_DIR, "var/node-coverage") nyc = os.path.join(ROOT_DIR, "node_modules/.bin/nyc") - command = [nyc, "--extension", ".hbs", "--extension", ".ts"] + command = [nyc] + command += [f"--extension={ext}" for ext in [".cjs", ".cts", ".hbs", ".mjs", ".mts", ".ts"]] command += ["--report-dir", coverage_dir] command += ["--temp-directory", coverage_dir] command += ["-r=lcov", "-r=json", "-r=text-summary"] command += node_tests_cmd else: # Normal testing, no coverage analysis. - # Run the index.js test runner, which runs all the other tests. + # Run the index.cjs test runner, which runs all the other tests. command = node_tests_cmd try: @@ -473,8 +474,8 @@ def enforce_proper_coverage(coverage_json: Any) -> bool: *glob.glob("web/src/*.js"), *glob.glob("web/src/*.ts"), *glob.glob("web/src/billing/*.js"), - *glob.glob("web/tests/*.js"), - *glob.glob("web/tests/lib/*.js"), + *glob.glob("web/tests/*.cjs"), + *glob.glob("web/tests/lib/*.cjs"), } missing_files = sorted(EXEMPT_FILES - all_js_files) assert not missing_files, f"Missing files should be removed from EXEMPT_FILES: {missing_files}" diff --git a/web/tests/activity.test.js b/web/tests/activity.test.cjs similarity index 99% rename from web/tests/activity.test.js rename to web/tests/activity.test.cjs index 4b660070ff..7bd51aedf0 100644 --- a/web/tests/activity.test.js +++ b/web/tests/activity.test.cjs @@ -8,12 +8,12 @@ const { buddy_list_add_user_matching_view, buddy_list_add_other_user, stub_buddy_list_elements, -} = require("./lib/buddy_list.js"); -const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +} = require("./lib/buddy_list.cjs"); +const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const $window_stub = $.create("window-stub"); set_global("to_$", () => $window_stub); diff --git a/web/tests/alert_words.test.js b/web/tests/alert_words.test.cjs similarity index 98% rename from web/tests/alert_words.test.js rename to web/tests/alert_words.test.cjs index 1c003a317c..0d788ec8ec 100644 --- a/web/tests/alert_words.test.js +++ b/web/tests/alert_words.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); set_global("page_params", { is_spectator: false, diff --git a/web/tests/alert_words_ui.test.js b/web/tests/alert_words_ui.test.cjs similarity index 95% rename from web/tests/alert_words_ui.test.js rename to web/tests/alert_words_ui.test.cjs index 6a8b027fc9..595a473155 100644 --- a/web/tests/alert_words_ui.test.js +++ b/web/tests/alert_words_ui.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {$t} = require("./lib/i18n.js"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {$t} = require("./lib/i18n.cjs"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const channel = mock_esm("../src/channel"); diff --git a/web/tests/blueslip_stacktrace.test.js b/web/tests/blueslip_stacktrace.test.cjs similarity index 94% rename from web/tests/blueslip_stacktrace.test.js rename to web/tests/blueslip_stacktrace.test.cjs index 726b611335..1e2f800edb 100644 --- a/web/tests/blueslip_stacktrace.test.js +++ b/web/tests/blueslip_stacktrace.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const blueslip_stacktrace = zrequire("blueslip_stacktrace"); diff --git a/web/tests/bot_data.test.js b/web/tests/bot_data.test.cjs similarity index 98% rename from web/tests/bot_data.test.js rename to web/tests/bot_data.test.cjs index bfd55f7724..bc4840fc88 100644 --- a/web/tests/bot_data.test.js +++ b/web/tests/bot_data.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const bot_data = zrequire("bot_data"); diff --git a/web/tests/browser_history.test.js b/web/tests/browser_history.test.cjs similarity index 92% rename from web/tests/browser_history.test.js rename to web/tests/browser_history.test.cjs index b99b7647a6..58bc36f0d0 100644 --- a/web/tests/browser_history.test.js +++ b/web/tests/browser_history.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {make_stub} = require("./lib/stub.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {make_stub} = require("./lib/stub.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); window.location.hash = "#bogus"; diff --git a/web/tests/buddy_data.test.js b/web/tests/buddy_data.test.cjs similarity index 98% rename from web/tests/buddy_data.test.js rename to web/tests/buddy_data.test.cjs index 4dda0e31d9..515edc46f7 100644 --- a/web/tests/buddy_data.test.js +++ b/web/tests/buddy_data.test.cjs @@ -4,9 +4,9 @@ const assert = require("node:assert/strict"); const _ = require("lodash"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); mock_esm("../src/settings_data", { user_can_access_all_other_users: () => true, @@ -35,7 +35,7 @@ const user_settings = {}; initialize_user_settings({user_settings}); // The buddy_data module is mostly tested indirectly through -// activity.test.js, but we should feel free to add direct tests +// activity.test.cjs, but we should feel free to add direct tests // here. const selma = { diff --git a/web/tests/buddy_list.test.js b/web/tests/buddy_list.test.cjs similarity index 97% rename from web/tests/buddy_list.test.js rename to web/tests/buddy_list.test.cjs index 99cf3c22aa..14bce71b30 100644 --- a/web/tests/buddy_list.test.js +++ b/web/tests/buddy_list.test.cjs @@ -10,11 +10,11 @@ const { buddy_list_add_user_matching_view, buddy_list_add_other_user, stub_buddy_list_elements, -} = require("./lib/buddy_list.js"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +} = require("./lib/buddy_list.cjs"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); const padded_widget = mock_esm("../src/padded_widget"); const message_viewport = mock_esm("../src/message_viewport"); diff --git a/web/tests/channel.test.js b/web/tests/channel.test.cjs similarity index 98% rename from web/tests/channel.test.js rename to web/tests/channel.test.cjs index f3466def0f..2d5fe1b341 100644 --- a/web/tests/channel.test.js +++ b/web/tests/channel.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_jquery, mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_jquery, mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const xhr_401 = { status: 401, diff --git a/web/tests/color_data.test.js b/web/tests/color_data.test.cjs similarity index 89% rename from web/tests/color_data.test.js rename to web/tests/color_data.test.cjs index a658e74256..034eeed686 100644 --- a/web/tests/color_data.test.js +++ b/web/tests/color_data.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const color_data = zrequire("color_data"); diff --git a/web/tests/common.test.js b/web/tests/common.test.cjs similarity index 98% rename from web/tests/common.test.js rename to web/tests/common.test.cjs index c6715fd35e..f08ace2ec0 100644 --- a/web/tests/common.test.js +++ b/web/tests/common.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); mock_esm("tippy.js", { default(arg) { diff --git a/web/tests/components.test.js b/web/tests/components.test.cjs similarity index 97% rename from web/tests/components.test.js rename to web/tests/components.test.cjs index d355750c96..3307c6a548 100644 --- a/web/tests/components.test.js +++ b/web/tests/components.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {$t} = require("./lib/i18n.js"); -const {mock_jquery, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {$t} = require("./lib/i18n.cjs"); +const {mock_jquery, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); let env; diff --git a/web/tests/compose.test.js b/web/tests/compose.test.cjs similarity index 99% rename from web/tests/compose.test.js rename to web/tests/compose.test.cjs index bd9798a321..530d615de1 100644 --- a/web/tests/compose.test.js +++ b/web/tests/compose.test.cjs @@ -4,11 +4,11 @@ const assert = require("node:assert/strict"); const MockDate = require("mockdate"); -const {mock_banners} = require("./lib/compose_banner.js"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_banners} = require("./lib/compose_banner.cjs"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const user_groups = zrequire("user_groups"); diff --git a/web/tests/compose_actions.test.js b/web/tests/compose_actions.test.cjs similarity index 98% rename from web/tests/compose_actions.test.js rename to web/tests/compose_actions.test.cjs index 1fb2aaf221..242a128299 100644 --- a/web/tests/compose_actions.test.js +++ b/web/tests/compose_actions.test.cjs @@ -2,11 +2,11 @@ const assert = require("node:assert/strict"); -const {mock_banners} = require("./lib/compose_banner.js"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +const {mock_banners} = require("./lib/compose_banner.cjs"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); const user_groups = zrequire("user_groups"); diff --git a/web/tests/compose_closed_ui.test.js b/web/tests/compose_closed_ui.test.cjs similarity index 97% rename from web/tests/compose_closed_ui.test.js rename to web/tests/compose_closed_ui.test.cjs index 43b1030a02..b761ad54f5 100644 --- a/web/tests/compose_closed_ui.test.js +++ b/web/tests/compose_closed_ui.test.cjs @@ -3,9 +3,9 @@ // Setup const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); // Mocking and stubbing things set_global("document", "document-stub"); diff --git a/web/tests/compose_fade.test.js b/web/tests/compose_fade.test.cjs similarity index 96% rename from web/tests/compose_fade.test.js rename to web/tests/compose_fade.test.cjs index 621a39682b..4b3334bcc9 100644 --- a/web/tests/compose_fade.test.js +++ b/web/tests/compose_fade.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_jquery, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_jquery, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); mock_jquery((selector) => { switch (selector) { diff --git a/web/tests/compose_pm_pill.test.js b/web/tests/compose_pm_pill.test.cjs similarity index 97% rename from web/tests/compose_pm_pill.test.js rename to web/tests/compose_pm_pill.test.cjs index 91f1545485..80661a53e7 100644 --- a/web/tests/compose_pm_pill.test.js +++ b/web/tests/compose_pm_pill.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const input_pill = mock_esm("../src/input_pill"); const people = zrequire("people"); diff --git a/web/tests/compose_state.test.js b/web/tests/compose_state.test.cjs similarity index 91% rename from web/tests/compose_state.test.js rename to web/tests/compose_state.test.cjs index 5aa4c4f7ce..0b2b935cb6 100644 --- a/web/tests/compose_state.test.js +++ b/web/tests/compose_state.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const compose_pm_pill = mock_esm("../src/compose_pm_pill"); diff --git a/web/tests/compose_ui.test.js b/web/tests/compose_ui.test.cjs similarity index 99% rename from web/tests/compose_ui.test.js rename to web/tests/compose_ui.test.cjs index e8014e940f..b60f7c5d57 100644 --- a/web/tests/compose_ui.test.js +++ b/web/tests/compose_ui.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {$t} = require("./lib/i18n.js"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {$t} = require("./lib/i18n.cjs"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); set_global("navigator", {}); diff --git a/web/tests/compose_validate.test.js b/web/tests/compose_validate.test.cjs similarity index 99% rename from web/tests/compose_validate.test.js rename to web/tests/compose_validate.test.cjs index 2cde480ab9..daa86e480f 100644 --- a/web/tests/compose_validate.test.js +++ b/web/tests/compose_validate.test.cjs @@ -2,12 +2,12 @@ const assert = require("node:assert/strict"); -const {mock_banners} = require("./lib/compose_banner.js"); -const {$t} = require("./lib/i18n.js"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +const {mock_banners} = require("./lib/compose_banner.cjs"); +const {$t} = require("./lib/i18n.cjs"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); const compose_banner = zrequire("compose_banner"); const compose_pm_pill = zrequire("compose_pm_pill"); diff --git a/web/tests/compose_video.test.js b/web/tests/compose_video.test.cjs similarity index 97% rename from web/tests/compose_video.test.js rename to web/tests/compose_video.test.cjs index 3c9f8adee7..bb951ce4ee 100644 --- a/web/tests/compose_video.test.js +++ b/web/tests/compose_video.test.cjs @@ -2,11 +2,11 @@ const assert = require("node:assert/strict"); -const events = require("./lib/events.js"); -const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +const events = require("./lib/events.cjs"); +const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const channel = mock_esm("../src/channel"); const compose_closed_ui = mock_esm("../src/compose_closed_ui"); diff --git a/web/tests/composebox_typeahead.test.js b/web/tests/composebox_typeahead.test.cjs similarity index 99% rename from web/tests/composebox_typeahead.test.js rename to web/tests/composebox_typeahead.test.cjs index 0a91faa61f..9ebded8755 100644 --- a/web/tests/composebox_typeahead.test.js +++ b/web/tests/composebox_typeahead.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_banners} = require("./lib/compose_banner.js"); -const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_banners} = require("./lib/compose_banner.cjs"); +const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); let autosize_called; diff --git a/web/tests/copy_and_paste.test.js b/web/tests/copy_and_paste.test.cjs similarity index 99% rename from web/tests/copy_and_paste.test.js rename to web/tests/copy_and_paste.test.cjs index ad15371bf6..1feb8a674e 100644 --- a/web/tests/copy_and_paste.test.js +++ b/web/tests/copy_and_paste.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const copy_and_paste = zrequire("copy_and_paste"); const stream_data = zrequire("stream_data"); diff --git a/web/tests/deprecated_feature_notice.test.js b/web/tests/deprecated_feature_notice.test.cjs similarity index 82% rename from web/tests/deprecated_feature_notice.test.js rename to web/tests/deprecated_feature_notice.test.cjs index feafb42d32..ae5f03a755 100644 --- a/web/tests/deprecated_feature_notice.test.js +++ b/web/tests/deprecated_feature_notice.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); set_global("navigator", { userAgent: "", diff --git a/web/tests/dispatch.test.js b/web/tests/dispatch.test.cjs similarity index 99% rename from web/tests/dispatch.test.js rename to web/tests/dispatch.test.cjs index 7732a4cfab..0202960b7e 100644 --- a/web/tests/dispatch.test.js +++ b/web/tests/dispatch.test.cjs @@ -2,13 +2,13 @@ const assert = require("node:assert/strict"); -const events = require("./lib/events.js"); -const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.js"); -const {make_stub} = require("./lib/stub.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +const events = require("./lib/events.cjs"); +const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.cjs"); +const {make_stub} = require("./lib/stub.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const event_fixtures = events.fixtures; const test_message = events.test_message; @@ -865,7 +865,7 @@ run_test("submessage", ({override}) => { }); }); -// For subscriptions, see dispatch_subs.test.js +// For subscriptions, see dispatch_subs.test.cjs run_test("typing", ({override}) => { // Simulate that we are not typing. diff --git a/web/tests/dispatch_subs.test.js b/web/tests/dispatch_subs.test.cjs similarity index 97% rename from web/tests/dispatch_subs.test.js rename to web/tests/dispatch_subs.test.cjs index 8c59f90c16..2e4812e002 100644 --- a/web/tests/dispatch_subs.test.js +++ b/web/tests/dispatch_subs.test.cjs @@ -2,11 +2,11 @@ const assert = require("node:assert/strict"); -const events = require("./lib/events.js"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {make_stub} = require("./lib/stub.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const events = require("./lib/events.cjs"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {make_stub} = require("./lib/stub.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const event_fixtures = events.fixtures; const test_user = events.test_user; diff --git a/web/tests/drafts.test.js b/web/tests/drafts.test.cjs similarity index 99% rename from web/tests/drafts.test.js rename to web/tests/drafts.test.cjs index 0214b5c2a3..b33f82dc64 100644 --- a/web/tests/drafts.test.js +++ b/web/tests/drafts.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_banners} = require("./lib/compose_banner.js"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_banners} = require("./lib/compose_banner.cjs"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const user_pill = mock_esm("../src/user_pill"); const messages_overlay_ui = mock_esm("../src/messages_overlay_ui"); diff --git a/web/tests/echo.test.js b/web/tests/echo.test.cjs similarity index 98% rename from web/tests/echo.test.js rename to web/tests/echo.test.cjs index 4829ac40cf..95d4b055f8 100644 --- a/web/tests/echo.test.js +++ b/web/tests/echo.test.cjs @@ -4,9 +4,9 @@ const assert = require("node:assert/strict"); const MockDate = require("mockdate"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {make_stub} = require("./lib/stub.js"); -const {run_test, noop} = require("./lib/test.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {make_stub} = require("./lib/stub.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); const compose_notifications = mock_esm("../src/compose_notifications"); const markdown = mock_esm("../src/markdown"); diff --git a/web/tests/emoji.test.js b/web/tests/emoji.test.cjs similarity index 95% rename from web/tests/emoji.test.js rename to web/tests/emoji.test.cjs index 7703dd4186..6f1281724c 100644 --- a/web/tests/emoji.test.js +++ b/web/tests/emoji.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const events = require("./lib/events.js"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const events = require("./lib/events.cjs"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const emoji_codes = zrequire("../../static/generated/emoji/emoji_codes.json"); diff --git a/web/tests/emoji_picker.test.js b/web/tests/emoji_picker.test.cjs similarity index 96% rename from web/tests/emoji_picker.test.js rename to web/tests/emoji_picker.test.cjs index 10b1d997e7..f8f873344b 100644 --- a/web/tests/emoji_picker.test.js +++ b/web/tests/emoji_picker.test.cjs @@ -4,8 +4,8 @@ const assert = require("node:assert/strict"); const _ = require("lodash"); -const {zrequire, set_global} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire, set_global} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const emoji = zrequire("emoji"); const emoji_picker = zrequire("emoji_picker"); diff --git a/web/tests/example1.test.js b/web/tests/example1.test.cjs similarity index 88% rename from web/tests/example1.test.js rename to web/tests/example1.test.cjs index 7dcf052a53..5886932dd8 100644 --- a/web/tests/example1.test.js +++ b/web/tests/example1.test.cjs @@ -9,10 +9,10 @@ // become clear as you keep reading. const assert = require("node:assert/strict"); -const {make_stream} = require("./lib/example_stream.js"); -const {make_user} = require("./lib/example_user.js"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {make_stream} = require("./lib/example_stream.cjs"); +const {make_user} = require("./lib/example_user.cjs"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); // We will use our special zrequire helper to import the // Zulip code. We use zrequire instead of require, @@ -43,7 +43,7 @@ const isaac = make_user({ // The `people` object is a very fundamental object in the // Zulip app. You can learn a lot more about it by reading -// the tests in people.test.js in the same directory as this file. +// the tests in people.test.cjs in the same directory as this file. // Let's exercise the code and use assert to verify it works! assert.ok(!people.is_known_user_id(isaac.user_id)); @@ -74,4 +74,4 @@ run_test("verify stream_data persists stream color", () => { const sub = stream_data.get_sub_by_name("Denmark"); assert.equal(sub.color, "a1a1a1"); }); -// See example2.test.js in this directory. +// See example2.test.cjs in this directory. diff --git a/web/tests/example2.test.js b/web/tests/example2.test.cjs similarity index 93% rename from web/tests/example2.test.js rename to web/tests/example2.test.cjs index 36be9a3ff3..aae5b4365e 100644 --- a/web/tests/example2.test.js +++ b/web/tests/example2.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {make_stream} = require("./lib/example_stream.js"); -const {make_user} = require("./lib/example_user.js"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {make_stream} = require("./lib/example_stream.cjs"); +const {make_user} = require("./lib/example_user.cjs"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); // Hopefully the basic patterns for testing data-oriented modules // are starting to become apparent. To reinforce that, we will present diff --git a/web/tests/example3.test.js b/web/tests/example3.test.cjs similarity index 94% rename from web/tests/example3.test.js rename to web/tests/example3.test.cjs index 22594da629..a1026d67d0 100644 --- a/web/tests/example3.test.js +++ b/web/tests/example3.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {make_stream} = require("./lib/example_stream.js"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {make_stream} = require("./lib/example_stream.cjs"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); // In the Zulip app you can narrow your message stream by topic, by // sender, by direct message recipient, by search keywords, etc. diff --git a/web/tests/example4.test.js b/web/tests/example4.test.cjs similarity index 95% rename from web/tests/example4.test.js rename to web/tests/example4.test.cjs index 74f0848051..9513bfb776 100644 --- a/web/tests/example4.test.js +++ b/web/tests/example4.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {make_bot} = require("./lib/example_user.js"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); +const {make_bot} = require("./lib/example_user.cjs"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); /* @@ -24,7 +24,7 @@ const {run_test, noop} = require("./lib/test.js"); you are interested, all of these objects have test suites that have 100% line coverage on the modules that implement those objects. For example, you can look - at people.test.js in this directory for more tests on the + at people.test.cjs in this directory for more tests on the people object. We can quickly review some testing concepts: diff --git a/web/tests/example5.test.js b/web/tests/example5.test.cjs similarity index 96% rename from web/tests/example5.test.js rename to web/tests/example5.test.cjs index f1858fe93d..b3bd1df8f1 100644 --- a/web/tests/example5.test.js +++ b/web/tests/example5.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {make_user} = require("./lib/example_user.js"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); +const {make_user} = require("./lib/example_user.cjs"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); /* Our test from an earlier example verifies that the update events diff --git a/web/tests/example6.test.js b/web/tests/example6.test.cjs similarity index 95% rename from web/tests/example6.test.js rename to web/tests/example6.test.cjs index bff63293be..556aa31ef3 100644 --- a/web/tests/example6.test.js +++ b/web/tests/example6.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {make_stub} = require("./lib/stub.js"); -const {run_test, noop} = require("./lib/test.js"); +const {make_stub} = require("./lib/stub.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); /* The previous example was a bit extreme. Generally we just diff --git a/web/tests/example7.test.js b/web/tests/example7.test.cjs similarity index 97% rename from web/tests/example7.test.js rename to web/tests/example7.test.cjs index 698878cc13..b095f95a01 100644 --- a/web/tests/example7.test.js +++ b/web/tests/example7.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {make_stream} = require("./lib/example_stream.js"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {make_stream} = require("./lib/example_stream.cjs"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); /* diff --git a/web/tests/example8.test.js b/web/tests/example8.test.cjs similarity index 96% rename from web/tests/example8.test.js rename to web/tests/example8.test.cjs index 5d804cd8bc..f72bc85731 100644 --- a/web/tests/example8.test.js +++ b/web/tests/example8.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {make_user} = require("./lib/example_user.js"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {make_user} = require("./lib/example_user.cjs"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); mock_esm("../src/settings_data", { user_can_access_all_other_users: () => true, diff --git a/web/tests/fenced_code.test.js b/web/tests/fenced_code.test.cjs similarity index 94% rename from web/tests/fenced_code.test.js rename to web/tests/fenced_code.test.cjs index 986107c92f..77f894cb21 100644 --- a/web/tests/fenced_code.test.js +++ b/web/tests/fenced_code.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const fenced_code = zrequire("../shared/src/fenced_code"); diff --git a/web/tests/fetch_status.test.js b/web/tests/fetch_status.test.cjs similarity index 97% rename from web/tests/fetch_status.test.js rename to web/tests/fetch_status.test.cjs index 52d0ecaaa2..6438f2cf1c 100644 --- a/web/tests/fetch_status.test.js +++ b/web/tests/fetch_status.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); mock_esm("../src/message_feed_loading", { hide_loading_older() {}, diff --git a/web/tests/filter.test.js b/web/tests/filter.test.cjs similarity index 99% rename from web/tests/filter.test.js rename to web/tests/filter.test.cjs index 30b0e182ee..5dbc0cfe04 100644 --- a/web/tests/filter.test.js +++ b/web/tests/filter.test.cjs @@ -4,11 +4,11 @@ const assert = require("node:assert/strict"); const {parseOneAddress} = require("email-addresses"); -const {mock_esm, with_overrides, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, with_overrides, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const message_store = mock_esm("../src/message_store"); const user_topics = mock_esm("../src/user_topics"); diff --git a/web/tests/fold_dict.test.js b/web/tests/fold_dict.test.cjs similarity index 95% rename from web/tests/fold_dict.test.js rename to web/tests/fold_dict.test.cjs index 75a3b995f1..81e2bc5e4e 100644 --- a/web/tests/fold_dict.test.js +++ b/web/tests/fold_dict.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const {FoldDict} = zrequire("fold_dict"); diff --git a/web/tests/gear_menu_util.test.js b/web/tests/gear_menu_util.test.cjs similarity index 97% rename from web/tests/gear_menu_util.test.js rename to web/tests/gear_menu_util.test.cjs index c7119c59ec..d6fc8a8556 100644 --- a/web/tests/gear_menu_util.test.js +++ b/web/tests/gear_menu_util.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const gear_menu_util = zrequire("gear_menu_util"); const {set_realm} = zrequire("state_data"); diff --git a/web/tests/hash_util.test.js b/web/tests/hash_util.test.cjs similarity index 98% rename from web/tests/hash_util.test.js rename to web/tests/hash_util.test.cjs index ba20605cde..852b5f0e2f 100644 --- a/web/tests/hash_util.test.js +++ b/web/tests/hash_util.test.cjs @@ -4,8 +4,8 @@ const assert = require("node:assert/strict"); const message_link_test_cases = require("../../zerver/tests/fixtures/message_link_test_cases.json"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const hash_parser = zrequire("hash_parser"); const hash_util = zrequire("hash_util"); diff --git a/web/tests/hashchange.test.js b/web/tests/hashchange.test.cjs similarity index 99% rename from web/tests/hashchange.test.js rename to web/tests/hashchange.test.cjs index c9da4b2012..0c32f666fb 100644 --- a/web/tests/hashchange.test.js +++ b/web/tests/hashchange.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); let $window_stub; set_global("to_$", () => $window_stub); diff --git a/web/tests/hotkey.test.js b/web/tests/hotkey.test.cjs similarity index 99% rename from web/tests/hotkey.test.js rename to web/tests/hotkey.test.cjs index d702b9db52..523faadcbf 100644 --- a/web/tests/hotkey.test.js +++ b/web/tests/hotkey.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.js"); -const {make_stub} = require("./lib/stub.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.cjs"); +const {make_stub} = require("./lib/stub.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); // Important note on these tests: diff --git a/web/tests/i18n.test.js b/web/tests/i18n.test.cjs similarity index 97% rename from web/tests/i18n.test.js rename to web/tests/i18n.test.cjs index 212009892a..c06fc1c8ad 100644 --- a/web/tests/i18n.test.js +++ b/web/tests/i18n.test.cjs @@ -4,9 +4,9 @@ const assert = require("node:assert/strict"); const _ = require("lodash"); -const {unmock_module, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {unmock_module, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); // We download our translations in `page_params` (which // are for the user's chosen language), so we simulate diff --git a/web/tests/input_pill.test.js b/web/tests/input_pill.test.cjs similarity index 99% rename from web/tests/input_pill.test.js rename to web/tests/input_pill.test.cjs index 1c897daa3c..6cd2cf2f64 100644 --- a/web/tests/input_pill.test.js +++ b/web/tests/input_pill.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); set_global("document", {}); class ClipboardEvent {} diff --git a/web/tests/internal_url.test.js b/web/tests/internal_url.test.cjs similarity index 95% rename from web/tests/internal_url.test.js rename to web/tests/internal_url.test.cjs index f5a0098324..7eb31fcbf3 100644 --- a/web/tests/internal_url.test.js +++ b/web/tests/internal_url.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const internal_url = zrequire("../shared/src/internal_url"); diff --git a/web/tests/keydown_util.test.js b/web/tests/keydown_util.test.cjs similarity index 92% rename from web/tests/keydown_util.test.js rename to web/tests/keydown_util.test.cjs index cf62358387..d8dc715f93 100644 --- a/web/tests/keydown_util.test.js +++ b/web/tests/keydown_util.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const keydown_util = zrequire("keydown_util"); diff --git a/web/tests/lazy_set.test.js b/web/tests/lazy_set.test.cjs similarity index 83% rename from web/tests/lazy_set.test.js rename to web/tests/lazy_set.test.cjs index 066e18eb5f..e01f82b20a 100644 --- a/web/tests/lazy_set.test.js +++ b/web/tests/lazy_set.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const {LazySet} = zrequire("lazy_set"); diff --git a/web/tests/left_sidebar_navigation_area.test.js b/web/tests/left_sidebar_navigation_area.test.cjs similarity index 98% rename from web/tests/left_sidebar_navigation_area.test.js rename to web/tests/left_sidebar_navigation_area.test.cjs index 20089431fa..80c38877fc 100644 --- a/web/tests/left_sidebar_navigation_area.test.js +++ b/web/tests/left_sidebar_navigation_area.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); mock_esm("../src/resize", { resize_stream_filters_container() {}, diff --git a/web/tests/lib/buddy_list.js b/web/tests/lib/buddy_list.cjs similarity index 95% rename from web/tests/lib/buddy_list.js rename to web/tests/lib/buddy_list.cjs index 6c6a3809a8..7b427854d2 100644 --- a/web/tests/lib/buddy_list.js +++ b/web/tests/lib/buddy_list.cjs @@ -1,7 +1,7 @@ "use strict"; -const {noop} = require("./test.js"); -const $ = require("./zjquery.js"); +const {noop} = require("./test.cjs"); +const $ = require("./zjquery.cjs"); let users_matching_view = []; exports.buddy_list_add_user_matching_view = (user_id, $stub) => { diff --git a/web/tests/lib/compose_banner.js b/web/tests/lib/compose_banner.cjs similarity index 95% rename from web/tests/lib/compose_banner.js rename to web/tests/lib/compose_banner.cjs index d7abe56b9b..c02c8a377b 100644 --- a/web/tests/lib/compose_banner.js +++ b/web/tests/lib/compose_banner.cjs @@ -2,8 +2,8 @@ const compose_banner = require("../../src/compose_banner.ts"); -const {noop} = require("./test.js"); -const $ = require("./zjquery.js"); +const {noop} = require("./test.cjs"); +const $ = require("./zjquery.cjs"); exports.mock_banners = () => { // zjquery doesn't support `remove`, which is used when clearing the compose box. diff --git a/web/tests/lib/events.js b/web/tests/lib/events.cjs similarity index 100% rename from web/tests/lib/events.js rename to web/tests/lib/events.cjs diff --git a/web/tests/lib/example_stream.js b/web/tests/lib/example_stream.cjs similarity index 100% rename from web/tests/lib/example_stream.js rename to web/tests/lib/example_stream.cjs diff --git a/web/tests/lib/example_user.js b/web/tests/lib/example_user.cjs similarity index 100% rename from web/tests/lib/example_user.js rename to web/tests/lib/example_user.cjs diff --git a/web/tests/lib/handlebars.js b/web/tests/lib/handlebars.cjs similarity index 100% rename from web/tests/lib/handlebars.js rename to web/tests/lib/handlebars.cjs diff --git a/web/tests/lib/i18n.js b/web/tests/lib/i18n.cjs similarity index 100% rename from web/tests/lib/i18n.js rename to web/tests/lib/i18n.cjs diff --git a/web/tests/lib/index.js b/web/tests/lib/index.cjs similarity index 89% rename from web/tests/lib/index.js rename to web/tests/lib/index.cjs index 3f0ecd5a45..21728b569e 100644 --- a/web/tests/lib/index.js +++ b/web/tests/lib/index.cjs @@ -8,14 +8,14 @@ require("handlebars/runtime.js"); const {JSDOM} = require("jsdom"); const _ = require("lodash"); -const handlebars = require("./handlebars.js"); -const stub_i18n = require("./i18n.js"); -const namespace = require("./namespace.js"); -const test = require("./test.js"); -const blueslip = require("./zblueslip.js"); -const zjquery = require("./zjquery.js"); -const zpage_billing_params = require("./zpage_billing_params.js"); -const zpage_params = require("./zpage_params.js"); +const handlebars = require("./handlebars.cjs"); +const stub_i18n = require("./i18n.cjs"); +const namespace = require("./namespace.cjs"); +const test = require("./test.cjs"); +const blueslip = require("./zblueslip.cjs"); +const zjquery = require("./zjquery.cjs"); +const zpage_billing_params = require("./zpage_billing_params.cjs"); +const zpage_params = require("./zpage_params.cjs"); process.env.NODE_ENV = "test"; @@ -88,7 +88,7 @@ require("../../src/templates.js"); // register Zulip extensions async function run_one_module(file) { zjquery.clear_initialize_function(); zjquery.clear_all_elements(); - console.info("running test " + path.basename(file, ".test.js")); + console.info("running test " + path.basename(file, ".test.cjs")); test.set_current_file_name(file); test.suite.length = 0; require(file); diff --git a/web/tests/lib/markdown_assert.js b/web/tests/lib/markdown_assert.cjs similarity index 99% rename from web/tests/lib/markdown_assert.js rename to web/tests/lib/markdown_assert.cjs index e13c4d0d8e..37337ca946 100644 --- a/web/tests/lib/markdown_assert.js +++ b/web/tests/lib/markdown_assert.cjs @@ -27,7 +27,7 @@ const assert = require("node:assert/strict"); const {JSDOM} = require("jsdom"); const _ = require("lodash"); -const mdiff = require("./mdiff.js"); +const mdiff = require("./mdiff.cjs"); // Module-level global instance of MarkdownComparer, initialized when needed let _markdownComparerInstance = null; diff --git a/web/tests/lib/mdiff.js b/web/tests/lib/mdiff.cjs similarity index 100% rename from web/tests/lib/mdiff.js rename to web/tests/lib/mdiff.cjs diff --git a/web/tests/lib/namespace.js b/web/tests/lib/namespace.cjs similarity index 99% rename from web/tests/lib/namespace.js rename to web/tests/lib/namespace.cjs index eecf58ff4d..b87f21c787 100644 --- a/web/tests/lib/namespace.js +++ b/web/tests/lib/namespace.cjs @@ -6,7 +6,7 @@ const path = require("node:path"); const callsites = require("callsites"); -const $ = require("./zjquery.js"); +const $ = require("./zjquery.cjs"); const new_globals = new Set(); let old_globals = {}; @@ -18,7 +18,7 @@ const used_module_mocks = new Set(); const used_templates = new Set(); const jquery_path = require.resolve("jquery"); -const real_jquery_path = require.resolve("./real_jquery.js"); +const real_jquery_path = require.resolve("./real_jquery.cjs"); let in_mid_render = false; let jquery_function; diff --git a/web/tests/lib/real_jquery.js b/web/tests/lib/real_jquery.cjs similarity index 100% rename from web/tests/lib/real_jquery.js rename to web/tests/lib/real_jquery.cjs diff --git a/web/tests/lib/stub.js b/web/tests/lib/stub.cjs similarity index 100% rename from web/tests/lib/stub.js rename to web/tests/lib/stub.cjs diff --git a/web/tests/lib/test.js b/web/tests/lib/test.cjs similarity index 82% rename from web/tests/lib/test.js rename to web/tests/lib/test.cjs index 1ae5f2fdec..d29b1a2ee0 100644 --- a/web/tests/lib/test.js +++ b/web/tests/lib/test.cjs @@ -1,10 +1,10 @@ "use strict"; -const namespace = require("./namespace.js"); -const zblueslip = require("./zblueslip.js"); -const $ = require("./zjquery.js"); -const zpage_billing_params = require("./zpage_billing_params.js"); -const zpage_params = require("./zpage_params.js"); +const namespace = require("./namespace.cjs"); +const zblueslip = require("./zblueslip.cjs"); +const $ = require("./zjquery.cjs"); +const zpage_billing_params = require("./zpage_billing_params.cjs"); +const zpage_params = require("./zpage_params.cjs"); let current_file_name; let verbose = false; diff --git a/web/tests/lib/zblueslip.js b/web/tests/lib/zblueslip.cjs similarity index 100% rename from web/tests/lib/zblueslip.js rename to web/tests/lib/zblueslip.cjs diff --git a/web/tests/lib/zjquery.js b/web/tests/lib/zjquery.cjs similarity index 98% rename from web/tests/lib/zjquery.js rename to web/tests/lib/zjquery.cjs index 69cf5d76cd..3a2c7e2c47 100644 --- a/web/tests/lib/zjquery.js +++ b/web/tests/lib/zjquery.cjs @@ -8,8 +8,8 @@ const assert = require("node:assert/strict"); and then subsequent calls to $("#foo") get the same instance. */ -const FakeElement = require("./zjquery_element.js"); -const FakeEvent = require("./zjquery_event.js"); +const FakeElement = require("./zjquery_element.cjs"); +const FakeEvent = require("./zjquery_event.cjs"); function verify_selector_for_zulip(selector) { const is_valid = diff --git a/web/tests/lib/zjquery_element.js b/web/tests/lib/zjquery_element.cjs similarity index 99% rename from web/tests/lib/zjquery_element.js rename to web/tests/lib/zjquery_element.cjs index 300e68ce8f..6b32d86e0a 100644 --- a/web/tests/lib/zjquery_element.js +++ b/web/tests/lib/zjquery_element.cjs @@ -2,7 +2,7 @@ const assert = require("node:assert/strict"); -const FakeEvent = require("./zjquery_event.js"); +const FakeEvent = require("./zjquery_event.cjs"); const noop = function () {}; diff --git a/web/tests/lib/zjquery_event.js b/web/tests/lib/zjquery_event.cjs similarity index 100% rename from web/tests/lib/zjquery_event.js rename to web/tests/lib/zjquery_event.cjs diff --git a/web/tests/lib/zpage_billing_params.js b/web/tests/lib/zpage_billing_params.cjs similarity index 100% rename from web/tests/lib/zpage_billing_params.js rename to web/tests/lib/zpage_billing_params.cjs diff --git a/web/tests/lib/zpage_params.js b/web/tests/lib/zpage_params.cjs similarity index 100% rename from web/tests/lib/zpage_params.js rename to web/tests/lib/zpage_params.cjs diff --git a/web/tests/linkifiers.test.js b/web/tests/linkifiers.test.cjs similarity index 92% rename from web/tests/linkifiers.test.js rename to web/tests/linkifiers.test.cjs index 15a885a53d..e953a6c910 100644 --- a/web/tests/linkifiers.test.js +++ b/web/tests/linkifiers.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const linkifiers = zrequire("linkifiers"); diff --git a/web/tests/list_cursor.test.js b/web/tests/list_cursor.test.cjs similarity index 94% rename from web/tests/list_cursor.test.js rename to web/tests/list_cursor.test.cjs index d1f68e8efb..7abb20dd3e 100644 --- a/web/tests/list_cursor.test.js +++ b/web/tests/list_cursor.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); const {ListCursor} = zrequire("list_cursor"); diff --git a/web/tests/list_widget.test.js b/web/tests/list_widget.test.cjs similarity index 99% rename from web/tests/list_widget.test.js rename to web/tests/list_widget.test.cjs index 4df7feb616..6cac822976 100644 --- a/web/tests/list_widget.test.js +++ b/web/tests/list_widget.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, mock_jquery, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, mock_jquery, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); // We need these stubs to get by instanceof checks. // The ListWidget library allows you to insert objects diff --git a/web/tests/markdown.test.js b/web/tests/markdown.test.cjs similarity index 99% rename from web/tests/markdown.test.js rename to web/tests/markdown.test.cjs index 5f8f522ebd..d8d675e0f6 100644 --- a/web/tests/markdown.test.js +++ b/web/tests/markdown.test.cjs @@ -6,10 +6,10 @@ const katex = require("katex"); const markdown_test_cases = require("../../zerver/tests/fixtures/markdown_test_cases.json"); -const markdown_assert = require("./lib/markdown_assert.js"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const {page_params} = require("./lib/zpage_params.js"); +const markdown_assert = require("./lib/markdown_assert.cjs"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const example_realm_linkifiers = [ { diff --git a/web/tests/markdown_parse.test.js b/web/tests/markdown_parse.test.cjs similarity index 99% rename from web/tests/markdown_parse.test.js rename to web/tests/markdown_parse.test.cjs index 56962f30f9..73a3570ee4 100644 --- a/web/tests/markdown_parse.test.js +++ b/web/tests/markdown_parse.test.cjs @@ -4,8 +4,8 @@ const assert = require("node:assert/strict"); const url_template_lib = require("url-template"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const markdown = zrequire("markdown"); const linkifiers = zrequire("linkifiers"); diff --git a/web/tests/message_edit.test.js b/web/tests/message_edit.test.cjs similarity index 99% rename from web/tests/message_edit.test.js rename to web/tests/message_edit.test.cjs index 2006923614..600ab4946f 100644 --- a/web/tests/message_edit.test.js +++ b/web/tests/message_edit.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const message_edit = zrequire("message_edit"); const people = zrequire("people"); diff --git a/web/tests/message_events.test.js b/web/tests/message_events.test.cjs similarity index 96% rename from web/tests/message_events.test.js rename to web/tests/message_events.test.cjs index fae7d28d65..cab4aac724 100644 --- a/web/tests/message_events.test.js +++ b/web/tests/message_events.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const message_edit = mock_esm("../src/message_edit"); const message_lists = mock_esm("../src/message_lists"); diff --git a/web/tests/message_flags.test.js b/web/tests/message_flags.test.cjs similarity index 99% rename from web/tests/message_flags.test.js rename to web/tests/message_flags.test.cjs index 919a28c1ed..edeb7599d4 100644 --- a/web/tests/message_flags.test.js +++ b/web/tests/message_flags.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, set_global, with_overrides, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const channel = mock_esm("../src/channel"); const message_live_update = mock_esm("../src/message_live_update"); diff --git a/web/tests/message_list.test.js b/web/tests/message_list.test.cjs similarity index 98% rename from web/tests/message_list.test.js rename to web/tests/message_list.test.cjs index a92da40f3f..f826061f3b 100644 --- a/web/tests/message_list.test.js +++ b/web/tests/message_list.test.cjs @@ -2,11 +2,11 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {make_stub} = require("./lib/stub.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {make_stub} = require("./lib/stub.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); // These unit tests for web/src/message_list.ts emphasize the model-ish // aspects of the MessageList class. We have to stub out a few functions diff --git a/web/tests/message_list_data.test.js b/web/tests/message_list_data.test.cjs similarity index 98% rename from web/tests/message_list_data.test.js rename to web/tests/message_list_data.test.cjs index 0bec24d531..e21a6fceea 100644 --- a/web/tests/message_list_data.test.js +++ b/web/tests/message_list_data.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const user_topics = zrequire("user_topics"); const muted_users = zrequire("muted_users"); diff --git a/web/tests/message_list_view.test.js b/web/tests/message_list_view.test.cjs similarity index 99% rename from web/tests/message_list_view.test.js rename to web/tests/message_list_view.test.cjs index cfdb2adf78..9b26d3773e 100644 --- a/web/tests/message_list_view.test.js +++ b/web/tests/message_list_view.test.cjs @@ -4,9 +4,9 @@ const assert = require("node:assert/strict"); const _ = require("lodash"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); set_global("document", "document-stub"); diff --git a/web/tests/message_store.test.js b/web/tests/message_store.test.cjs similarity index 99% rename from web/tests/message_store.test.js rename to web/tests/message_store.test.cjs index a36b66d329..3eb77ae311 100644 --- a/web/tests/message_store.test.js +++ b/web/tests/message_store.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); mock_esm("../src/settings_data", { user_can_access_all_other_users: () => true, diff --git a/web/tests/message_view.test.js b/web/tests/message_view.test.cjs similarity index 99% rename from web/tests/message_view.test.js rename to web/tests/message_view.test.cjs index 6a62490498..92de3c4ab6 100644 --- a/web/tests/message_view.test.js +++ b/web/tests/message_view.test.cjs @@ -2,11 +2,11 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const hash_util = zrequire("hash_util"); const compose_state = zrequire("compose_state"); diff --git a/web/tests/muted_users.test.js b/web/tests/muted_users.test.cjs similarity index 96% rename from web/tests/muted_users.test.js rename to web/tests/muted_users.test.cjs index 3b7f1bcada..c724249f42 100644 --- a/web/tests/muted_users.test.js +++ b/web/tests/muted_users.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const muted_users = zrequire("muted_users"); const {initialize_user_settings} = zrequire("user_settings"); diff --git a/web/tests/narrow_local.test.js b/web/tests/narrow_local.test.cjs similarity index 99% rename from web/tests/narrow_local.test.js rename to web/tests/narrow_local.test.cjs index 47fb6812cf..c4d6bd2883 100644 --- a/web/tests/narrow_local.test.js +++ b/web/tests/narrow_local.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const all_messages_data = zrequire("../src/all_messages_data"); diff --git a/web/tests/narrow_state.test.js b/web/tests/narrow_state.test.cjs similarity index 98% rename from web/tests/narrow_state.test.js rename to web/tests/narrow_state.test.cjs index 2725240134..9c99fcf55b 100644 --- a/web/tests/narrow_state.test.js +++ b/web/tests/narrow_state.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const people = zrequire("people"); const {Filter} = zrequire("../src/filter"); diff --git a/web/tests/narrow_unread.test.js b/web/tests/narrow_unread.test.cjs similarity index 98% rename from web/tests/narrow_unread.test.js rename to web/tests/narrow_unread.test.cjs index 4e02256e1f..d760a74dde 100644 --- a/web/tests/narrow_unread.test.js +++ b/web/tests/narrow_unread.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); mock_esm("../src/user_topics", { is_topic_muted: () => false, diff --git a/web/tests/navbar_alerts.test.js b/web/tests/navbar_alerts.test.cjs similarity index 96% rename from web/tests/navbar_alerts.test.js rename to web/tests/navbar_alerts.test.cjs index f016f259a6..8a286cfd05 100644 --- a/web/tests/navbar_alerts.test.js +++ b/web/tests/navbar_alerts.test.cjs @@ -4,9 +4,9 @@ const assert = require("node:assert/strict"); const {addDays} = require("date-fns"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); page_params.is_spectator = false; diff --git a/web/tests/notifications.test.js b/web/tests/notifications.test.cjs similarity index 98% rename from web/tests/notifications.test.js rename to web/tests/notifications.test.cjs index 994a368770..1a925155c1 100644 --- a/web/tests/notifications.test.js +++ b/web/tests/notifications.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); mock_esm("../src/electron_bridge"); mock_esm("../src/spoilers", {hide_spoilers_in_notification() {}}); diff --git a/web/tests/password.test.js b/web/tests/password.test.cjs similarity index 95% rename from web/tests/password.test.js rename to web/tests/password.test.cjs index 431055d6ee..7a51d14441 100644 --- a/web/tests/password.test.js +++ b/web/tests/password.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const {password_quality, password_warning} = zrequire("password_quality"); diff --git a/web/tests/peer_data.test.js b/web/tests/peer_data.test.cjs similarity index 98% rename from web/tests/peer_data.test.js rename to web/tests/peer_data.test.cjs index 5ca6c99e37..37969914a5 100644 --- a/web/tests/peer_data.test.js +++ b/web/tests/peer_data.test.cjs @@ -8,10 +8,10 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const peer_data = zrequire("peer_data"); const people = zrequire("people"); diff --git a/web/tests/people.test.js b/web/tests/people.test.cjs similarity index 99% rename from web/tests/people.test.js rename to web/tests/people.test.cjs index 72d45470be..dd13e68ed1 100644 --- a/web/tests/people.test.js +++ b/web/tests/people.test.cjs @@ -6,11 +6,11 @@ const {parseISO} = require("date-fns"); const _ = require("lodash"); const MockDate = require("mockdate"); -const {$t} = require("./lib/i18n.js"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {$t} = require("./lib/i18n.cjs"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const message_user_ids = mock_esm("../src/message_user_ids"); const settings_data = mock_esm("../src/settings_data", { diff --git a/web/tests/people_errors.test.js b/web/tests/people_errors.test.cjs similarity index 95% rename from web/tests/people_errors.test.js rename to web/tests/people_errors.test.cjs index e14edcb7ac..5dfc1387a1 100644 --- a/web/tests/people_errors.test.js +++ b/web/tests/people_errors.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const reload_state = mock_esm("../src/reload_state", { is_in_progress: () => false, diff --git a/web/tests/pill_typeahead.test.js b/web/tests/pill_typeahead.test.cjs similarity index 99% rename from web/tests/pill_typeahead.test.js rename to web/tests/pill_typeahead.test.cjs index b759bc4772..e987462c6a 100644 --- a/web/tests/pill_typeahead.test.js +++ b/web/tests/pill_typeahead.test.cjs @@ -2,11 +2,11 @@ const assert = require("node:assert/strict"); -const {zrequire, mock_esm} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {zrequire, mock_esm} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const noop = function () {}; diff --git a/web/tests/pm_conversations.test.js b/web/tests/pm_conversations.test.cjs similarity index 98% rename from web/tests/pm_conversations.test.js rename to web/tests/pm_conversations.test.cjs index bcc27e3754..4002ffeed1 100644 --- a/web/tests/pm_conversations.test.js +++ b/web/tests/pm_conversations.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const user_topics = zrequire("user_topics"); const muted_users = zrequire("muted_users"); diff --git a/web/tests/pm_list.test.js b/web/tests/pm_list.test.cjs similarity index 84% rename from web/tests/pm_list.test.js rename to web/tests/pm_list.test.cjs index bab781edbc..1f8d3b593f 100644 --- a/web/tests/pm_list.test.js +++ b/web/tests/pm_list.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const pm_list = zrequire("pm_list"); diff --git a/web/tests/pm_list_data.test.js b/web/tests/pm_list_data.test.cjs similarity index 98% rename from web/tests/pm_list_data.test.js rename to web/tests/pm_list_data.test.cjs index 4122a97d1f..82a2a0fd89 100644 --- a/web/tests/pm_list_data.test.js +++ b/web/tests/pm_list_data.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const unread = mock_esm("../src/unread"); diff --git a/web/tests/poll_widget.test.js b/web/tests/poll_widget.test.cjs similarity index 98% rename from web/tests/poll_widget.test.js rename to web/tests/poll_widget.test.cjs index 41f3b79b15..887b5f5594 100644 --- a/web/tests/poll_widget.test.js +++ b/web/tests/poll_widget.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); mock_esm("../src/settings_data", { user_can_access_all_other_users: () => true, diff --git a/web/tests/popover_menus_data.test.js b/web/tests/popover_menus_data.test.cjs similarity index 97% rename from web/tests/popover_menus_data.test.js rename to web/tests/popover_menus_data.test.cjs index 306f0ce98c..6e37fc7018 100644 --- a/web/tests/popover_menus_data.test.js +++ b/web/tests/popover_menus_data.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const {Filter} = zrequire("filter"); const {MessageList} = zrequire("message_list"); diff --git a/web/tests/postprocess_content.test.js b/web/tests/postprocess_content.test.cjs similarity index 98% rename from web/tests/postprocess_content.test.js rename to web/tests/postprocess_content.test.cjs index 0974dd01ca..2b43c4226c 100644 --- a/web/tests/postprocess_content.test.js +++ b/web/tests/postprocess_content.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const thumbnail = mock_esm("../src/thumbnail"); diff --git a/web/tests/presence.test.js b/web/tests/presence.test.cjs similarity index 98% rename from web/tests/presence.test.js rename to web/tests/presence.test.cjs index ccd6018b93..1c38d93890 100644 --- a/web/tests/presence.test.js +++ b/web/tests/presence.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); mock_esm("../src/settings_data", { user_can_access_all_other_users: () => true, diff --git a/web/tests/reactions.test.js b/web/tests/reactions.test.cjs similarity index 99% rename from web/tests/reactions.test.js rename to web/tests/reactions.test.cjs index 89333d9f6c..527498412d 100644 --- a/web/tests/reactions.test.js +++ b/web/tests/reactions.test.cjs @@ -2,12 +2,12 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {make_stub} = require("./lib/stub.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {make_stub} = require("./lib/stub.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const alice_user_id = 5; diff --git a/web/tests/realm_playground.test.js b/web/tests/realm_playground.test.cjs similarity index 98% rename from web/tests/realm_playground.test.js rename to web/tests/realm_playground.test.cjs index 5495e96001..f0a1706ab3 100644 --- a/web/tests/realm_playground.test.js +++ b/web/tests/realm_playground.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const {$t} = zrequire("i18n"); const pygments_data = zrequire("pygments_data"); diff --git a/web/tests/recent_senders.test.js b/web/tests/recent_senders.test.cjs similarity index 98% rename from web/tests/recent_senders.test.js rename to web/tests/recent_senders.test.cjs index a224e8dda4..02487d3735 100644 --- a/web/tests/recent_senders.test.js +++ b/web/tests/recent_senders.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); let next_id = 0; const messages = new Map(); diff --git a/web/tests/recent_view.test.js b/web/tests/recent_view.test.cjs similarity index 99% rename from web/tests/recent_view.test.js rename to web/tests/recent_view.test.cjs index 1326156d27..91de5a3aae 100644 --- a/web/tests/recent_view.test.js +++ b/web/tests/recent_view.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); window.scrollTo = noop; const test_url = () => "https://www.example.com"; @@ -62,7 +62,7 @@ const ListWidget = mock_esm("../src/list_widget", { opts.filter.predicate(item); } // Just for coverage, the mechanisms - // are tested in list_widget.test.js + // are tested in list_widget.test.cjs if (mapped_topic_values.length >= 2) { opts.sort_fields.stream_sort(mapped_topic_values[0], mapped_topic_values[1]); opts.sort_fields.stream_sort(mapped_topic_values[1], mapped_topic_values[0]); diff --git a/web/tests/reload.test.js b/web/tests/reload.test.cjs similarity index 90% rename from web/tests/reload.test.js rename to web/tests/reload.test.cjs index 816dde8879..09861da1a5 100644 --- a/web/tests/reload.test.js +++ b/web/tests/reload.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); // override file-level function call in reload.ts window.addEventListener = noop; diff --git a/web/tests/reload_state.test.js b/web/tests/reload_state.test.cjs similarity index 86% rename from web/tests/reload_state.test.js rename to web/tests/reload_state.test.cjs index 26082ca368..e10adae127 100644 --- a/web/tests/reload_state.test.js +++ b/web/tests/reload_state.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const reload_state = zrequire("reload_state"); diff --git a/web/tests/rendered_markdown.test.js b/web/tests/rendered_markdown.test.cjs similarity index 99% rename from web/tests/rendered_markdown.test.js rename to web/tests/rendered_markdown.test.cjs index 3058e5b901..66b19adf13 100644 --- a/web/tests/rendered_markdown.test.js +++ b/web/tests/rendered_markdown.test.cjs @@ -2,11 +2,11 @@ const assert = require("node:assert/strict"); -const {$t} = require("./lib/i18n.js"); -const {mock_cjs, mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +const {$t} = require("./lib/i18n.cjs"); +const {mock_cjs, mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); let clipboard_args; class Clipboard { diff --git a/web/tests/resolved_topic.test.js b/web/tests/resolved_topic.test.cjs similarity index 95% rename from web/tests/resolved_topic.test.js rename to web/tests/resolved_topic.test.cjs index 809346cafe..5f6f15ab46 100644 --- a/web/tests/resolved_topic.test.js +++ b/web/tests/resolved_topic.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const resolved_topic = zrequire("../shared/src/resolved_topic"); diff --git a/web/tests/rtl.test.js b/web/tests/rtl.test.cjs similarity index 98% rename from web/tests/rtl.test.js rename to web/tests/rtl.test.cjs index 421f03c209..fa442838a5 100644 --- a/web/tests/rtl.test.js +++ b/web/tests/rtl.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const rtl = zrequire("rtl"); diff --git a/web/tests/saved_snippets.test.js b/web/tests/saved_snippets.test.cjs similarity index 92% rename from web/tests/saved_snippets.test.js rename to web/tests/saved_snippets.test.cjs index b430080902..da4c4af4af 100644 --- a/web/tests/saved_snippets.test.js +++ b/web/tests/saved_snippets.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {$t} = require("./lib/i18n.js"); -const {set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {$t} = require("./lib/i18n.cjs"); +const {set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); set_global("page_params", { is_spectator: false, diff --git a/web/tests/scheduled_messages.test.js b/web/tests/scheduled_messages.test.cjs similarity index 98% rename from web/tests/scheduled_messages.test.js rename to web/tests/scheduled_messages.test.cjs index a13ca16f11..6925d26ea0 100644 --- a/web/tests/scheduled_messages.test.js +++ b/web/tests/scheduled_messages.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const scheduled_messages = zrequire("scheduled_messages"); const compose_send_menu_popover = zrequire("compose_send_menu_popover"); diff --git a/web/tests/scroll_util.test.js b/web/tests/scroll_util.test.cjs similarity index 96% rename from web/tests/scroll_util.test.js rename to web/tests/scroll_util.test.cjs index c014ff3f9a..754ff30afa 100644 --- a/web/tests/scroll_util.test.js +++ b/web/tests/scroll_util.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const scroll_util = zrequire("scroll_util"); diff --git a/web/tests/search.test.js b/web/tests/search.test.cjs similarity index 99% rename from web/tests/search.test.js rename to web/tests/search.test.cjs index 6450dc4dd7..9844f483d6 100644 --- a/web/tests/search.test.js +++ b/web/tests/search.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const bootstrap_typeahead = mock_esm("../src/bootstrap_typeahead"); const search_suggestion = mock_esm("../src/search_suggestion"); diff --git a/web/tests/search_suggestion.test.js b/web/tests/search_suggestion.test.cjs similarity index 99% rename from web/tests/search_suggestion.test.js rename to web/tests/search_suggestion.test.cjs index 31c0cc44ed..1adf03961f 100644 --- a/web/tests/search_suggestion.test.js +++ b/web/tests/search_suggestion.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const narrow_state = mock_esm("../src/narrow_state"); const stream_topic_history_util = mock_esm("../src/stream_topic_history_util"); diff --git a/web/tests/server_events.test.js b/web/tests/server_events.test.cjs similarity index 95% rename from web/tests/server_events.test.js rename to web/tests/server_events.test.cjs index ab2fc1414d..62d31f825b 100644 --- a/web/tests/server_events.test.js +++ b/web/tests/server_events.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); mock_esm("../src/loading", { destroy_indicator: noop, diff --git a/web/tests/settings_bots.test.js b/web/tests/settings_bots.test.cjs similarity index 96% rename from web/tests/settings_bots.test.js rename to web/tests/settings_bots.test.cjs index 8d29f39398..f67f78efeb 100644 --- a/web/tests/settings_bots.test.js +++ b/web/tests/settings_bots.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const bot_data_params = { realm_bots: [ diff --git a/web/tests/settings_config.test.js b/web/tests/settings_config.test.cjs similarity index 98% rename from web/tests/settings_config.test.js rename to web/tests/settings_config.test.cjs index 86d2422d5b..f7c01f8435 100644 --- a/web/tests/settings_config.test.js +++ b/web/tests/settings_config.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const settings_config = zrequire("settings_config"); const {set_realm} = zrequire("state_data"); diff --git a/web/tests/settings_data.test.js b/web/tests/settings_data.test.cjs similarity index 99% rename from web/tests/settings_data.test.js rename to web/tests/settings_data.test.cjs index a214ee54d2..a271e505a3 100644 --- a/web/tests/settings_data.test.js +++ b/web/tests/settings_data.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, with_overrides, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, with_overrides, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const settings_data = zrequire("settings_data"); const settings_config = zrequire("settings_config"); diff --git a/web/tests/settings_emoji.test.js b/web/tests/settings_emoji.test.cjs similarity index 85% rename from web/tests/settings_emoji.test.js rename to web/tests/settings_emoji.test.cjs index 221a9e0c72..de9332dc4d 100644 --- a/web/tests/settings_emoji.test.js +++ b/web/tests/settings_emoji.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const upload_widget = mock_esm("../src/upload_widget"); const settings_emoji = zrequire("settings_emoji"); diff --git a/web/tests/settings_muted_users.test.js b/web/tests/settings_muted_users.test.cjs similarity index 95% rename from web/tests/settings_muted_users.test.js rename to web/tests/settings_muted_users.test.cjs index ed35b6e5b2..9d9aa24f9c 100644 --- a/web/tests/settings_muted_users.test.js +++ b/web/tests/settings_muted_users.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const channel = mock_esm("../src/channel"); const list_widget = mock_esm("../src/list_widget", { diff --git a/web/tests/settings_org.test.js b/web/tests/settings_org.test.cjs similarity index 99% rename from web/tests/settings_org.test.js rename to web/tests/settings_org.test.cjs index 6223afbeee..fde57155c1 100644 --- a/web/tests/settings_org.test.js +++ b/web/tests/settings_org.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {$t} = require("./lib/i18n.js"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {$t} = require("./lib/i18n.cjs"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const realm_icon = mock_esm("../src/realm_icon"); diff --git a/web/tests/settings_profile_fields.test.js b/web/tests/settings_profile_fields.test.cjs similarity index 98% rename from web/tests/settings_profile_fields.test.js rename to web/tests/settings_profile_fields.test.cjs index 9eb9674190..0db62151c8 100644 --- a/web/tests/settings_profile_fields.test.js +++ b/web/tests/settings_profile_fields.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, with_overrides, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, with_overrides, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const loading = mock_esm("../src/loading"); diff --git a/web/tests/settings_realm_domains.test.js b/web/tests/settings_realm_domains.test.cjs similarity index 95% rename from web/tests/settings_realm_domains.test.js rename to web/tests/settings_realm_domains.test.cjs index c38984b627..74804edb23 100644 --- a/web/tests/settings_realm_domains.test.js +++ b/web/tests/settings_realm_domains.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const channel = mock_esm("../src/channel"); mock_esm("../src/ui_report", { diff --git a/web/tests/settings_user_topics.test.js b/web/tests/settings_user_topics.test.cjs similarity index 95% rename from web/tests/settings_user_topics.test.js rename to web/tests/settings_user_topics.test.cjs index f152815914..07bf75f552 100644 --- a/web/tests/settings_user_topics.test.js +++ b/web/tests/settings_user_topics.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const list_widget = mock_esm("../src/list_widget", { generic_sort_functions: noop, diff --git a/web/tests/spoilers.test.js b/web/tests/spoilers.test.cjs similarity index 89% rename from web/tests/spoilers.test.js rename to web/tests/spoilers.test.cjs index 9c8ec78da1..c725abfb1c 100644 --- a/web/tests/spoilers.test.js +++ b/web/tests/spoilers.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const spoilers = zrequire("spoilers"); diff --git a/web/tests/starred_messages.test.js b/web/tests/starred_messages.test.cjs similarity index 97% rename from web/tests/starred_messages.test.js rename to web/tests/starred_messages.test.cjs index 9b23f62db8..770a58bc63 100644 --- a/web/tests/starred_messages.test.js +++ b/web/tests/starred_messages.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, with_overrides, zrequire} = require("./lib/namespace.js"); -const {make_stub} = require("./lib/stub.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, with_overrides, zrequire} = require("./lib/namespace.cjs"); +const {make_stub} = require("./lib/stub.cjs"); +const {run_test} = require("./lib/test.cjs"); const left_sidebar_navigation_area = mock_esm("../src/left_sidebar_navigation_area", { update_starred_count() {}, diff --git a/web/tests/stream_create_subscribers_data.test.js b/web/tests/stream_create_subscribers_data.test.cjs similarity index 98% rename from web/tests/stream_create_subscribers_data.test.js rename to web/tests/stream_create_subscribers_data.test.cjs index 5660a0aa35..756b6ed1f5 100644 --- a/web/tests/stream_create_subscribers_data.test.js +++ b/web/tests/stream_create_subscribers_data.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const people = zrequire("people"); const {set_current_user} = zrequire("state_data"); diff --git a/web/tests/stream_data.test.js b/web/tests/stream_data.test.cjs similarity index 99% rename from web/tests/stream_data.test.js rename to web/tests/stream_data.test.cjs index 4b02a099a5..c528ead2d9 100644 --- a/web/tests/stream_data.test.js +++ b/web/tests/stream_data.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); // TODO: Remove after we enable support for // web_public_streams in production. diff --git a/web/tests/stream_edit.test.js b/web/tests/stream_edit.test.cjs similarity index 95% rename from web/tests/stream_edit.test.js rename to web/tests/stream_edit.test.cjs index d45955135e..f0501b2718 100644 --- a/web/tests/stream_edit.test.js +++ b/web/tests/stream_edit.test.cjs @@ -4,7 +4,7 @@ const assert = require("node:assert/strict"); const {get_stream_email_address} = require("../src/stream_edit.ts"); -const {run_test} = require("./lib/test.js"); +const {run_test} = require("./lib/test.cjs"); run_test("get_stream_email_address", () => { let address = "announce.747b04693224b5d2f0d409b66ccd3866@zulipdev.com"; diff --git a/web/tests/stream_events.test.js b/web/tests/stream_events.test.cjs similarity index 98% rename from web/tests/stream_events.test.js rename to web/tests/stream_events.test.cjs index cb9132349f..c6cb11062b 100644 --- a/web/tests/stream_events.test.js +++ b/web/tests/stream_events.test.cjs @@ -2,11 +2,11 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {make_stub} = require("./lib/stub.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {make_stub} = require("./lib/stub.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); const browser_history = mock_esm("../src/browser_history"); const color_data = mock_esm("../src/color_data"); diff --git a/web/tests/stream_list.test.js b/web/tests/stream_list.test.cjs similarity index 99% rename from web/tests/stream_list.test.js rename to web/tests/stream_list.test.cjs index b9acb9f533..2ffb78575e 100644 --- a/web/tests/stream_list.test.js +++ b/web/tests/stream_list.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); -const {page_params} = require("./lib/zpage_params.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); +const {page_params} = require("./lib/zpage_params.cjs"); const people = zrequire("people"); const {set_current_user} = zrequire("state_data"); diff --git a/web/tests/stream_list_sort.test.js b/web/tests/stream_list_sort.test.cjs similarity index 99% rename from web/tests/stream_list_sort.test.js rename to web/tests/stream_list_sort.test.cjs index 877d943f5c..ce9bff785a 100644 --- a/web/tests/stream_list_sort.test.js +++ b/web/tests/stream_list_sort.test.cjs @@ -4,8 +4,8 @@ const assert = require("node:assert/strict"); const _ = require("lodash"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const people = zrequire("people"); const stream_data = zrequire("stream_data"); diff --git a/web/tests/stream_pill.test.js b/web/tests/stream_pill.test.cjs similarity index 97% rename from web/tests/stream_pill.test.js rename to web/tests/stream_pill.test.cjs index 0d01040252..fcebee9eb6 100644 --- a/web/tests/stream_pill.test.js +++ b/web/tests/stream_pill.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const peer_data = zrequire("peer_data"); const people = zrequire("people"); diff --git a/web/tests/stream_search.test.js b/web/tests/stream_search.test.cjs similarity index 96% rename from web/tests/stream_search.test.js rename to web/tests/stream_search.test.cjs index 3e24eb4b7a..ec3ac77af1 100644 --- a/web/tests/stream_search.test.js +++ b/web/tests/stream_search.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); // This tests the stream searching functionality which currently // lives in stream_list.ts. diff --git a/web/tests/stream_settings_ui.test.js b/web/tests/stream_settings_ui.test.cjs similarity index 99% rename from web/tests/stream_settings_ui.test.js rename to web/tests/stream_settings_ui.test.cjs index 823e8122e0..651456ca3d 100644 --- a/web/tests/stream_settings_ui.test.js +++ b/web/tests/stream_settings_ui.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const denmark_stream_id = 101; diff --git a/web/tests/stream_topic_history.test.js b/web/tests/stream_topic_history.test.cjs similarity index 99% rename from web/tests/stream_topic_history.test.js rename to web/tests/stream_topic_history.test.cjs index ee6d176861..9452a31751 100644 --- a/web/tests/stream_topic_history.test.js +++ b/web/tests/stream_topic_history.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); const channel = mock_esm("../src/channel"); const message_util = mock_esm("../src/message_util"); diff --git a/web/tests/submessage.test.js b/web/tests/submessage.test.cjs similarity index 95% rename from web/tests/submessage.test.js rename to web/tests/submessage.test.cjs index 263a12280b..88f282b7e4 100644 --- a/web/tests/submessage.test.js +++ b/web/tests/submessage.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const channel = mock_esm("../src/channel"); const message_store = mock_esm("../src/message_store"); diff --git a/web/tests/support.test.js b/web/tests/support.test.cjs similarity index 91% rename from web/tests/support.test.js rename to web/tests/support.test.cjs index 7994a097ac..b73e7aaea6 100644 --- a/web/tests/support.test.js +++ b/web/tests/support.test.cjs @@ -6,9 +6,9 @@ const path = require("node:path"); const {JSDOM} = require("jsdom"); -const {mock_cjs, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_cjs, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const template = fs.readFileSync( path.resolve(__dirname, "../../templates/corporate/support/realm_details.html"), diff --git a/web/tests/templates.test.js b/web/tests/templates.test.cjs similarity index 98% rename from web/tests/templates.test.js rename to web/tests/templates.test.cjs index 4e837c0fc3..6efc63383a 100644 --- a/web/tests/templates.test.js +++ b/web/tests/templates.test.cjs @@ -2,7 +2,7 @@ const assert = require("node:assert/strict"); -const {run_test} = require("./lib/test.js"); +const {run_test} = require("./lib/test.cjs"); /* Note that the test runner automatically registers diff --git a/web/tests/time_zone_util.test.js b/web/tests/time_zone_util.test.cjs similarity index 97% rename from web/tests/time_zone_util.test.js rename to web/tests/time_zone_util.test.cjs index 631b0ad790..b5a0579f87 100644 --- a/web/tests/time_zone_util.test.js +++ b/web/tests/time_zone_util.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const {get_offset, start_of_day, is_same_day, difference_in_calendar_days} = zrequire("time_zone_util"); diff --git a/web/tests/timerender.test.js b/web/tests/timerender.test.cjs similarity index 99% rename from web/tests/timerender.test.js rename to web/tests/timerender.test.cjs index 8481cbf7f8..20dfe363b7 100644 --- a/web/tests/timerender.test.js +++ b/web/tests/timerender.test.cjs @@ -5,10 +5,10 @@ const assert = require("node:assert/strict"); const {add} = require("date-fns"); const MockDate = require("mockdate"); -const {$t} = require("./lib/i18n.js"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {$t} = require("./lib/i18n.cjs"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const {initialize_user_settings} = zrequire("user_settings"); diff --git a/web/tests/topic_generator.test.js b/web/tests/topic_generator.test.cjs similarity index 98% rename from web/tests/topic_generator.test.js rename to web/tests/topic_generator.test.cjs index c81a0893a3..b76679002a 100644 --- a/web/tests/topic_generator.test.js +++ b/web/tests/topic_generator.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const pm_conversations = mock_esm("../src/pm_conversations", { recent: {}, diff --git a/web/tests/topic_link_util.test.js b/web/tests/topic_link_util.test.cjs similarity index 97% rename from web/tests/topic_link_util.test.js rename to web/tests/topic_link_util.test.cjs index 605a8461dc..3b078ec030 100644 --- a/web/tests/topic_link_util.test.js +++ b/web/tests/topic_link_util.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const topic_link_util = zrequire("topic_link_util"); const stream_data = zrequire("stream_data"); diff --git a/web/tests/topic_list_data.test.js b/web/tests/topic_list_data.test.cjs similarity index 99% rename from web/tests/topic_list_data.test.js rename to web/tests/topic_list_data.test.cjs index 173ff2d3bd..c1afc0fd8f 100644 --- a/web/tests/topic_list_data.test.js +++ b/web/tests/topic_list_data.test.cjs @@ -4,8 +4,8 @@ const assert = require("node:assert/strict"); const _ = require("lodash"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); mock_esm("../src/message_store", { get() { diff --git a/web/tests/transmit.test.js b/web/tests/transmit.test.cjs similarity index 97% rename from web/tests/transmit.test.js rename to web/tests/transmit.test.cjs index 6520a0734a..a3ca623c82 100644 --- a/web/tests/transmit.test.js +++ b/web/tests/transmit.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const channel = mock_esm("../src/channel"); const reload = mock_esm("../src/reload"); diff --git a/web/tests/typeahead.test.js b/web/tests/typeahead.test.cjs similarity index 99% rename from web/tests/typeahead.test.js rename to web/tests/typeahead.test.cjs index 24cfe2cf3e..83d492f7bf 100644 --- a/web/tests/typeahead.test.js +++ b/web/tests/typeahead.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const typeahead = zrequire("../shared/src/typeahead"); diff --git a/web/tests/typeahead_helper.test.js b/web/tests/typeahead_helper.test.cjs similarity index 99% rename from web/tests/typeahead_helper.test.js rename to web/tests/typeahead_helper.test.cjs index abdd32ea5c..35940d3305 100644 --- a/web/tests/typeahead_helper.test.js +++ b/web/tests/typeahead_helper.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const stream_topic_history = mock_esm("../src/stream_topic_history"); diff --git a/web/tests/typing_data.test.js b/web/tests/typing_data.test.cjs similarity index 98% rename from web/tests/typing_data.test.js rename to web/tests/typing_data.test.cjs index b480c6aea7..365ba4fd10 100644 --- a/web/tests/typing_data.test.js +++ b/web/tests/typing_data.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const muted_users = zrequire("muted_users"); const typing_data = zrequire("typing_data"); diff --git a/web/tests/typing_events.test.js b/web/tests/typing_events.test.cjs similarity index 96% rename from web/tests/typing_events.test.js rename to web/tests/typing_events.test.cjs index f8dd6de28f..99008a3656 100644 --- a/web/tests/typing_events.test.js +++ b/web/tests/typing_events.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const settings_data = mock_esm("../src/settings_data"); diff --git a/web/tests/typing_status.test.js b/web/tests/typing_status.test.cjs similarity index 99% rename from web/tests/typing_status.test.js rename to web/tests/typing_status.test.cjs index 960df3f3fc..d906e64af3 100644 --- a/web/tests/typing_status.test.js +++ b/web/tests/typing_status.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const compose_pm_pill = mock_esm("../src/compose_pm_pill"); const compose_state = mock_esm("../src/compose_state"); diff --git a/web/tests/ui_util.test.js b/web/tests/ui_util.test.cjs similarity index 94% rename from web/tests/ui_util.test.js rename to web/tests/ui_util.test.cjs index a9076458b5..f0e7fc7ff8 100644 --- a/web/tests/ui_util.test.js +++ b/web/tests/ui_util.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const ui_util = zrequire("ui_util"); diff --git a/web/tests/unread.test.js b/web/tests/unread.test.cjs similarity index 99% rename from web/tests/unread.test.js rename to web/tests/unread.test.cjs index ac5d39fabf..6152337b0f 100644 --- a/web/tests/unread.test.js +++ b/web/tests/unread.test.cjs @@ -4,8 +4,8 @@ const assert = require("node:assert/strict"); const _ = require("lodash"); -const {set_global, with_overrides, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {set_global, with_overrides, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); set_global("document", "document-stub"); const {FoldDict} = zrequire("fold_dict"); diff --git a/web/tests/upload.test.js b/web/tests/upload.test.cjs similarity index 99% rename from web/tests/upload.test.js rename to web/tests/upload.test.cjs index ee1c31fc41..3bf5a84b9f 100644 --- a/web/tests/upload.test.js +++ b/web/tests/upload.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); class ClipboardEvent { constructor({clipboardData}) { diff --git a/web/tests/user_events.test.js b/web/tests/user_events.test.cjs similarity index 98% rename from web/tests/user_events.test.js rename to web/tests/user_events.test.cjs index d1ea196e2f..69936eda59 100644 --- a/web/tests/user_events.test.js +++ b/web/tests/user_events.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); const message_live_update = mock_esm("../src/message_live_update"); const navbar_alerts = mock_esm("../src/navbar_alerts"); diff --git a/web/tests/user_group_pill.test.js b/web/tests/user_group_pill.test.cjs similarity index 97% rename from web/tests/user_group_pill.test.js rename to web/tests/user_group_pill.test.cjs index 32e0a53bf0..5a1869f96e 100644 --- a/web/tests/user_group_pill.test.js +++ b/web/tests/user_group_pill.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const user_groups = zrequire("user_groups"); const user_group_pill = zrequire("user_group_pill"); diff --git a/web/tests/user_groups.test.js b/web/tests/user_groups.test.cjs similarity index 99% rename from web/tests/user_groups.test.js rename to web/tests/user_groups.test.cjs index 79a344c4e0..d2e8772501 100644 --- a/web/tests/user_groups.test.js +++ b/web/tests/user_groups.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const user_groups = zrequire("user_groups"); const {set_realm} = zrequire("state_data"); diff --git a/web/tests/user_pill.test.js b/web/tests/user_pill.test.cjs similarity index 96% rename from web/tests/user_pill.test.js rename to web/tests/user_pill.test.cjs index d47c81dcfe..ec83eaef7a 100644 --- a/web/tests/user_pill.test.js +++ b/web/tests/user_pill.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const people = zrequire("people"); const user_pill = zrequire("user_pill"); diff --git a/web/tests/user_search.test.js b/web/tests/user_search.test.cjs similarity index 98% rename from web/tests/user_search.test.js rename to web/tests/user_search.test.cjs index 9b5966ed10..15eb0504c5 100644 --- a/web/tests/user_search.test.js +++ b/web/tests/user_search.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {set_global, mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test, noop} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {set_global, mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test, noop} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); const fake_buddy_list = { scroll_container_selector: "#whatever", diff --git a/web/tests/user_status.test.js b/web/tests/user_status.test.cjs similarity index 97% rename from web/tests/user_status.test.js rename to web/tests/user_status.test.cjs index 37d44838fe..ebe0310b34 100644 --- a/web/tests/user_status.test.js +++ b/web/tests/user_status.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {mock_esm, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {mock_esm, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const channel = mock_esm("../src/channel"); diff --git a/web/tests/user_topics.test.js b/web/tests/user_topics.test.cjs similarity index 98% rename from web/tests/user_topics.test.js rename to web/tests/user_topics.test.cjs index 66d169f106..fd9b5304bf 100644 --- a/web/tests/user_topics.test.js +++ b/web/tests/user_topics.test.cjs @@ -4,9 +4,9 @@ const assert = require("node:assert/strict"); const {all_visibility_policies} = require("../src/user_topics.ts"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const user_topics = zrequire("user_topics"); const stream_data = zrequire("stream_data"); diff --git a/web/tests/user_topics_ui.test.js b/web/tests/user_topics_ui.test.cjs similarity index 97% rename from web/tests/user_topics_ui.test.js rename to web/tests/user_topics_ui.test.cjs index 00b8a504e1..395f502460 100644 --- a/web/tests/user_topics_ui.test.js +++ b/web/tests/user_topics_ui.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const user_topics = zrequire("user_topics"); const user_topics_ui = zrequire("user_topics_ui"); diff --git a/web/tests/util.test.js b/web/tests/util.test.cjs similarity index 99% rename from web/tests/util.test.js rename to web/tests/util.test.cjs index 420aee5f8b..fdc8876d76 100644 --- a/web/tests/util.test.js +++ b/web/tests/util.test.cjs @@ -5,8 +5,8 @@ const assert = require("node:assert/strict"); const _ = require("lodash"); const MockDate = require("mockdate"); -const {set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); +const {set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); const blueslip = zrequire("blueslip"); const {initialize_user_settings} = zrequire("user_settings"); diff --git a/web/tests/vdom.test.js b/web/tests/vdom.test.cjs similarity index 97% rename from web/tests/vdom.test.js rename to web/tests/vdom.test.cjs index a9e9e82d3d..a8606091e0 100644 --- a/web/tests/vdom.test.js +++ b/web/tests/vdom.test.cjs @@ -2,9 +2,9 @@ const assert = require("node:assert/strict"); -const {zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); const vdom = zrequire("vdom"); diff --git a/web/tests/watchdog.test.js b/web/tests/watchdog.test.cjs similarity index 92% rename from web/tests/watchdog.test.js rename to web/tests/watchdog.test.cjs index 075db73b3c..287928a7bf 100644 --- a/web/tests/watchdog.test.js +++ b/web/tests/watchdog.test.cjs @@ -4,9 +4,9 @@ const assert = require("node:assert/strict"); const MockDate = require("mockdate"); -const {set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); let time = 0; let checker; diff --git a/web/tests/widgetize.test.js b/web/tests/widgetize.test.cjs similarity index 97% rename from web/tests/widgetize.test.js rename to web/tests/widgetize.test.cjs index b4cb568fa4..f5c6a04c49 100644 --- a/web/tests/widgetize.test.js +++ b/web/tests/widgetize.test.cjs @@ -2,10 +2,10 @@ const assert = require("node:assert/strict"); -const {mock_esm, set_global, zrequire} = require("./lib/namespace.js"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); -const $ = require("./lib/zjquery.js"); +const {mock_esm, set_global, zrequire} = require("./lib/namespace.cjs"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); +const $ = require("./lib/zjquery.cjs"); const sample_events = [ { diff --git a/web/tests/zblueslip.test.js b/web/tests/zblueslip.test.cjs similarity index 95% rename from web/tests/zblueslip.test.js rename to web/tests/zblueslip.test.cjs index 10f58ffa2e..8e1460d405 100644 --- a/web/tests/zblueslip.test.js +++ b/web/tests/zblueslip.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {run_test} = require("./lib/test.js"); -const blueslip = require("./lib/zblueslip.js"); +const {run_test} = require("./lib/test.cjs"); +const blueslip = require("./lib/zblueslip.cjs"); /* @@ -23,10 +23,10 @@ What is zblueslip? The code we are testing lives here: - https://github.com/zulip/zulip/blob/main/web/tests/lib/zblueslip.js + https://github.com/zulip/zulip/blob/main/web/tests/lib/zblueslip.cjs Read the following contents for an overview of how zblueslip works. Also take a -look at `people_errors.test.js` for actual usage of this module. +look at `people_errors.test.cjs` for actual usage of this module. */ run_test("basics", () => { diff --git a/web/tests/zjquery.test.js b/web/tests/zjquery.test.cjs similarity index 98% rename from web/tests/zjquery.test.js rename to web/tests/zjquery.test.cjs index d7226e7fd0..9e07e503d3 100644 --- a/web/tests/zjquery.test.js +++ b/web/tests/zjquery.test.cjs @@ -2,8 +2,8 @@ const assert = require("node:assert/strict"); -const {run_test} = require("./lib/test.js"); -const $ = require("./lib/zjquery.js"); +const {run_test} = require("./lib/test.cjs"); +const $ = require("./lib/zjquery.cjs"); /* @@ -25,7 +25,7 @@ What is zjquery? The code we are testing lives here: - https://github.com/zulip/zulip/blob/main/web/tests/lib/zjquery.js + https://github.com/zulip/zulip/blob/main/web/tests/lib/zjquery.cjs */ diff --git a/zerver/lib/mdiff.py b/zerver/lib/mdiff.py index 3cced977bf..23d2355f41 100644 --- a/zerver/lib/mdiff.py +++ b/zerver/lib/mdiff.py @@ -8,7 +8,7 @@ class DiffError(Exception): def diff_strings(output: str, expected_output: str) -> str: - mdiff_path = "web/tests/lib/mdiff.js" + mdiff_path = "web/tests/lib/mdiff.cjs" if not os.path.isfile(mdiff_path): # nocoverage msg = "Cannot find mdiff for Markdown diff rendering" logging.error(msg) diff --git a/zerver/tests/test_markdown.py b/zerver/tests/test_markdown.py index 74684fe75b..bd3f3d27da 100644 --- a/zerver/tests/test_markdown.py +++ b/zerver/tests/test_markdown.py @@ -1621,7 +1621,7 @@ class MarkdownLinkifierTest(ZulipTestCase): ) def test_topic_links_ordering_by_priority(self) -> None: - # The same test case is also implemented in web/tests/markdown_parse.test.js + # The same test case is also implemented in web/tests/markdown_parse.test.cjs realm = get_realm("zulip") self.check_add_linkifiers( [