mozilla / activity-stream

A refreshed "new tab page" for Firefox
Mozilla Public License 2.0
183 stars 113 forks source link

Inconsistent usage of test names in test/* directory #1056

Closed pdehaan closed 7 years ago

pdehaan commented 8 years ago

Ref: https://github.com/mozilla/activity-stream/pull/1055#discussion_r74100065

In some files, we use something like:

exports["test activity stream loads on home page when appropriate"] = function(assert) {

But in other files files we use:

exports.test_filter_urls = function(assert) {

We probably want to try and be consistent with the exports["test name as string"] versus exports.test_name_as_snake_case style.

pdehaan commented 8 years ago
$ git grep "exports\[" test/

test/test-ActivityStreams-awesomebar-empty.js:exports["test awesomebar is empty for all app urls"] = function*(assert) {
test/test-ActivityStreams-awesomebar-empty.js:exports["test awesomebar is empty for all app urls in new windows too"] = function*(assert) {
test/test-ActivityStreams-awesomebar-empty.js:exports["test awesomebar remains empty on route changes"] = function*(assert) {
test/test-ActivityStreams-awesomebar-empty.js:exports["test awesomebar doesn't clear out what user typed"] = function*(assert) {
test/test-ActivityStreams-home-page.js:exports["test activity stream loads on home page when appropriate"] = function(assert) {
test/test-ActivityStreams-message-passing.js:exports["test receive message"] = function*(assert) {
test/test-ActivityStreams-message-passing.js:exports["test app.send message"] = function*(assert) {
test/test-ActivityStreams-message-passing.js:exports["test app.broadcast message"] = function*(assert) {
test/test-ActivityStreams-places-caching.js:exports["test caching follows prefs"] = function*(assert) {
test/test-ActivityStreams-places-caching.js:exports["test cache invalidation on history change"] = function*(assert) {
test/test-ActivityStreams-places-caching.js:exports["test cache invalidation on blocklist change"] = function*(assert) {
test/test-ActivityStreams-places-caching.js:exports["test rebuilds don't clobber each other"] = function*(assert) {
test/test-ActivityStreams-private-browsing.js:exports["test activity stream doesn't load in private windows"] = function*(assert) {
test/test-ActivityStreams-workers.js:exports["test load worker"] = function(assert, done) {
test/test-ActivityStreams-workers.js:exports["test removing worker on url change"] = function(assert, done) {
test/test-ActivityStreams-workers.js:exports["test workers for page reload"] = function(assert, done) {
test/test-ColorAnalyzerProvider.js:exports["test getColor"] = function*(assert) {
test/test-ColorAnalyzerProvider.js:exports["test getColor errors"] = function*(assert) {
test/test-ExperimentProvider.js:exports["test ExperimentProvider"] = assert => {
test/test-ExperimentProvider.js:exports["test ExperimentProvider._rng"] = assert => {
test/test-ExperimentProvider.js:exports["test ExperimentProvider.experimentId"] = assert => {
test/test-ExperimentProvider.js:exports["test ExperimentProvider.data"] = assert => {
test/test-ExperimentProvider.js:exports["test ExperimentProvider only selects one experiment"] = assert => {
test/test-ExperimentProvider.js:exports["test ExperimentProvider skips experiments with active = false"] = assert => {
test/test-ExperimentProvider.js:exports["test ActivityStreams has experimentProvider instance"] = assert => {
test/test-PlacesProvider-blockedURLs.js:exports["test blocklist init"] = function(assert) {
test/test-PlacesProvider-blockedURLs.js:exports["test blocklist basic functions"] = function(assert) {
test/test-TippyTopProvider.js:exports["test TippyTopProvider init"] = function(assert) {
test/test-TippyTopProvider.js:exports["test TippyTopProvider processSite"] = function(assert) {

VERSUS:

$ git grep "exports\.test_" test/

test/test-Memoizer.js:exports.test_memoizer = function*(assert) {
test/test-Memoizer.js:exports.test_memoizer_replace_opt = function*(assert) {
test/test-Memoizer.js:exports.test_memoizer_replace_opt_sub_key = function*(assert) {
test/test-Memoizer.js:exports.test_memoizer_prefs = function*(assert) {
test/test-Memoizer.js:exports.test_memoizer_simple_params = function*(assert) {
test/test-Memoizer.js:exports.test_memoizer_object_params = function*(assert) {
test/test-MetadataStore.js:exports.test_insert_single = function*(assert) {
test/test-MetadataStore.js:exports.test_insert_partial = function*(assert) {
test/test-MetadataStore.js:exports.test_insert_partial_images = function*(assert) {
test/test-MetadataStore.js:exports.test_insert_required_fields = function*(assert) {
test/test-MetadataStore.js:exports.test_insert_twice = function*(assert) {
test/test-MetadataStore.js:exports.test_async_insert_all = function*(assert) {
test/test-MetadataStore.js:exports.test_async_get_by_cache_key = function*(assert) {
test/test-MetadataStore.js:exports.test_async_get_by_cache_key_in_special_cases = function*(assert) {
test/test-MetadataStore.js:exports.test_on_an_invalid_connection = function*(assert) {
test/test-MetadataStore.js:exports.test_color_conversions = function(assert) {
test/test-MetadataStore.js:exports.test_data_expiry = function*(assert) {
test/test-MetadataStore.js:exports.test_delete = function*(assert) {
test/test-PerfMeter.js:exports.test_PerfMeter_init = function(assert) {
test/test-PerfMeter.js:exports.test_PerfMeter_events = function*(assert) {
test/test-PerfMeter.js:exports.test_PerfMeter_pref = function*(assert) {
test/test-PerfMeter.js:exports.test_PerfMeter_tab_hygiene = function*(assert) {
test/test-PerfMeter.js:exports.test_PerfMeter_sample_stats = function(assert) {
test/test-PerfMeter.js:exports.test_PerfMeter_tab_restore = function*(assert) {
test/test-PlacesProvider.js:exports.test_LinkChecker_securityCheck = function(assert) {
test/test-PlacesProvider.js:exports.test_Links_getTopFrecentSites = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_getTopFrecentSites_Order = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_getHighlightsLinks = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_getRecentLinks = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_getFrecentLinks = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_asyncAddBookmark = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_asyncDeleteBookmark = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_deleteHistoryLink = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_getRecentBookmarks_Order = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_bookmark_notifications = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_onLinkChanged = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_onClearHistory = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_onDeleteURI = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links_onManyLinksChanged = function*(assert) {
test/test-PlacesProvider.js:exports.test_Links__faviconBytesToDataURI = function(assert) {
test/test-PlacesProvider.js:exports.test_Links_getHistorySize = function*(assert) {
test/test-PlacesProvider.js:exports.test_blocked_urls = function*(assert) {
test/test-PreviewProvider-MetadataStore.js:exports.test_metadatastore_saves_new_links = function*(assert) {
test/test-PreviewProvider-MetadataStore.js:exports.test_find_correct_links = function*(assert) {
test/test-PreviewProvider-MetadataStore.js:exports.test_get_links_from_metadatastore = function*(assert) {
test/test-PreviewProvider.js:exports.test_only_request_links_once = function*(assert) {
test/test-PreviewProvider.js:exports.test_filter_urls = function(assert) {
test/test-PreviewProvider.js:exports.test_sanitize_urls = function(assert) {
test/test-PreviewProvider.js:exports.test_process_links = function(assert) {
test/test-PreviewProvider.js:exports.test_dedupe_urls = function(assert) {
test/test-PreviewProvider.js:exports.test_throw_out_non_requested_responses = function*(assert) {
test/test-PreviewProvider.js:exports.test_mock_embedly_request = function*(assert) {
test/test-PreviewProvider.js:exports.test_get_enhanced_disabled = function*(assert) {
test/test-PreviewProvider.js:exports.test_get_enhanced_previews_only = function*(assert) {
test/test-RecommendationProvider.js:exports.test_get_recommended_content = function*(assert) {
test/test-RecommendationProvider.js:exports.test_update_recommendations = function*(assert) {
test/test-RecommendationProvider.js:exports.test_get_a_recommendation = function(assert) {
test/test-RecommendationProvider.js:exports.test_get_a_new_recommendation = function(assert) {
test/test-RecommendationProvider.js:exports.test_set_blocked_recommendation = function(assert) {
test/test-RecommendationProvider.js:exports.test_random_recommendation = function(assert) {
test/test-SearchProvider.js:exports.test_SearchProvider_state = function*(assert) {
test/test-SearchProvider.js:exports.test_SearchProvider_observe = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_init = function(assert) {
test/test-TabTracker.js:exports.test_TabTracker_open_close_tab = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_unfocus_unloaded_tab = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_back_button_load = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_reactivating = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_close_window_with_multitabs = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_refresh = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_action_pings = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_unload_reason_with_user_action = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_performance_action_pings = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_handleRouteChange_FirstLoad = function(assert) {
test/test-TabTracker.js:exports.test_TabTracker_handleRouteChange = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_prefs = function(assert) {
test/test-TabTracker.js:exports.test_TabTracker_latency = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_History_And_Bookmark_Reporting = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_pageType = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_session_reports = function*(assert) {
test/test-TabTracker.js:exports.test_TabTracker_disable_ping = function*(assert) {
test/test-TelemetrySender.js:exports.test_TelemetrySender_init = function(assert, done) {
test/test-TelemetrySender.js:exports.test_TelemetrySender_prefs = function(assert) {